Archived topic
How to have a mobile menu with submenus open by default
3 replies · Started by Stephane Bergeron on March 9, 2020
Hi,
I've Googled this and checked the forum but, other than creating a different menu with everything at the same level (which is not really a solution for me), I haven't found a way to do this.
I'm working on a client site doing a "technical refresh" and moving from Genesis/Dynamik to GPP. If you go to the current site on mobile or use dev tools to see it in a mobile format, you'll see that when you open the mobile menu, the one (large) submenu under "services" is open by default:
https://bnurture.com/articles/
If you check the development copy where GPP is installed and the migration of the site's visuals is in progress, the mobile menu opens with the "Services" submenu closed.
https://dev.bnurture.com/contact/
Is there a way other than using a different menu to have the submenu open by default?
THanks!
Hi there,
Would something like this help?
https://generatepress.com/forums/topic/always-expand-mobile-navigation-to-current-child-page/#post-1184177
Hi!
That worked after modifying the selector as I need it open everywhere, so this worked:
.main-navigation.toggled .main-nav ul ul.sub-menu {
position: relative;
top: 0;
left: auto!important;
right: auto!important;
width: 100%;
pointer-events: auto;
height: auto;
opacity: 1;
display: block;
visibility: visible;
}
Thank you very much! :)
No problem :)