Site logo

Archived topic

Keep dropdown submenu items visible

61 replies · Started by Ingrid on December 27, 2016

Viewing posts 1–15 of 62

Hi,

I use the primary navigation in my right-sidebar and I would like the submenu-items of the active parent menu to remain visible / unfolded. Is this possible?

Thanks in advance for your help!

Hi there,

You could try something like this:

.sidebar .main-navigation .main-nav .sub-menu {
    opacity: 1 !important;
    display: block !important;
    left: auto;
    right: auto !important;
    position: relative;
    width: 100%;
    clear: both !important;
    top: auto;
    float: none;
}

.sidebar .dropdown-menu-toggle {
    display: none;
}

Thanks for your fast reply!

This works great! But I would love to keep the option to use the dropdown-function when none of the sub-items of a specific main-menu item is active. In the ideal world the menu should act as follows;
* When the main menu item, or one of its submenu-items is active > display all the submenu-items as block
* When none of the submenu-items or the main menu-item is active > display only the main-menu item with dropdown arrow.

Somehow the CSS you provided should be linked to the same category the 'background current' for menu-items is, is this possible?

Hmm, maybe give this a shot:

.sidebar .main-navigation .main-nav .current-menu-item .sub-menu, 
.sidebar .main-navigation .main-nav .current-menu-ancestor .sub-menu {
    opacity: 1;
    left: auto;
    right: auto !important;
    position: relative;
    width: 100%;
    clear: both !important;
    top: auto;
    float: none;
    visibility: visible;
    pointer-events: auto;
    height: auto;
    display: block;
}

.sidebar .current-menu-item .dropdown-menu-toggle, 
.sidebar .current-menu-ancestor .dropdown-menu-toggle {
    display: none;
}

Unfortunately that doesn't work when one of the sub-menu items is active / current.

I have another problem that also occurs without any extra CSS. The main / parent menu-item is not clickable from the sidebar menu. When I hover over it, it shows the correct url in the bottom left corner of my screen, but when I click it, nothing happens. Only the sub-menu items work when I click on them. Any idea how to solve that?

I can get over not being able to hide the submenu-items of inactive parents :-), but I do need to be able to use the main/parent menu-item from the sidebar menu.

Thanks again for your help!

Menu works great!! Just the way I wanted! Thank you so much!

It's still in progress, but you can see it at; http://nieuw.yalyn.com. As soon as I remove the sub-items the parent item is clickable (see 'naslagwerk'), but when I add sub-items the parent doesn't respond anymore...

Solved! Thanks for the great support!

You're welcome :)

Hi
That is great! but my problem is that I will put many links and I would need only to open the corresponding submenu. And also activate the main menus where it is active. I do not know if I explain myself well because my English is very poor.

Hi there,

Any chance you can open a new topic and provide an example of what you are looking for?

Thanks!

But my question is about this topic. I did what Tom said to make the active submenu visible. This leaves all submenus open within the main menu and prevents it from closing. You can see it here in the sidebar: http://bit.ly/2yrHR5e

In that menu I still have to add a lot of submenus, so that all the submenus would be open and I just want the asset to open.

I hope I have explained myself better.

Hmm I don't see a sidebar on that page?

Sorry, try now

This archived topic is closed to new replies.