Site logo

Archived topic

Keep sub-menu open

7 replies · Started by Marc on June 12, 2019

Viewing posts 1–8 of 8

I have the following situation:

- Page 1
-- Subpage 1a
-- Subpage 1b
-- Subpage 1c
- Page 2
-- Subpage 2a
-- Subpage 2b
-- Subpage 2c
- Page 3
- Page 4

Now I want to have the following. If the user is on Page 1 (or on a subpage) and opens the menu, then the subnavigation should be open and show the subpages. This should only happen on the mobile version (because most people don't know, that they have to click on the arrow to open the submenu).

How can I make this possible?

Thank you very much in advance for your help!

Hi there,

Give this a shot:

.toggled .current-menu-item > .sub-menu, 
.toggled .current-menu-ancestor > .sub-menu {
    visibility: visible;
    height: auto;
    opacity: 1;
    left: auto;
    overflow: visible;
    position: relative;
    pointer-events: auto;
}

.toggled .current-menu-item > a > .dropdown-menu-toggle, 
.toggled .current-menu-ancestor > a > .dropdown-menu-toggle {
    display: none;
}

Let me know :)

Dear Tom!

Thank you very much for your help! The menu keeps open if I am on the page. But if I am on a subpage, it does not work :-(

Do you have an idea?

Kind regards

Hi there,

Is the CSS active right now? I'm not seeing it on the site.

Let me know :)

Dear Tom!

I've deactivated it. Now it's active again. Here is the problem. I click on a 1st level menu item and the submenu keeps open. Now I click on a submenu item (2nd level) and the submenu disappears. I am talking about the mobile version.

Thank you very much in advance for your help!

Kind regards,

Marc

I'm trying to do the same thing on my site and I've added the above but it doesn't seem to have done anything. Do you know if this is possible using just css?

This archived topic is closed to new replies.