Archived topic
Navigation Dropdown Click Menu Item: Is it possible to change the bahavior?
26 replies · Started by itcwiz on November 7, 2017
I just adjusted the CSS above: https://generatepress.com/forums/topic/navigation-dropdown-click-menu-item-is-it-possible-to-change-the-bahavior/#post-420303
Let me know if it works better now :)
Tom, this is perfect!!!!! It is exactly what I wanted. Thank you for your help!
You're welcome :)
Hi Tom,
I updated today GP 2.0.2 and my functionality which I wanted in this post, does not fully work any longer. This means, if I am on a subpage, this css does not work any longer (I want, if I am on a subpage, that the navigation stays open, does not dissapear). Right now I have to hover again on the parent-page, so that the submenu appears again...
.main-navigation .main-nav li.current-menu-item .sub-menu {
display: block !important;
opacity: 1 !important;
}
Can you please help me?
I just edited the previous code so it will work with GP 2.0.
Thank you so much! I tried it, but does not work. Any way, does the part make sense (it is the same two rows):
.main-navigation .main-nav li .sub-menu,
.main-navigation .main-nav li .sub-menu {
display: none !important;
}
If I activate this, then the main menu does not expand at all .... If I take this out, the submenu does not stay opened on a subpage. Can you help?
Think I see the issue. Can you try the updated CSS?: https://generatepress.com/forums/topic/navigation-dropdown-click-menu-item-is-it-possible-to-change-the-bahavior/#post-420303
Thank you Tom! It is almost perfect (petra.it-couture.ch). When I am on the main menu end hover over "Chalet Kristall", and then click, the submenu opens. If I click on "Ausstattung", for a moment the submenu slides to the right, and then back. Do you know how to fix this? Thank you for your support!
You currently have this:
.dropdown-hover .main-navigation:not(.toggled) ul li:hover > ul {
left: 0px !important;
}
Replace it with this:
.dropdown-hover .main-navigation:not(.toggled) ul li:hover>ul,
.dropdown-hover .main-navigation:not(.toggled) ul li.sfHover>ul {
left: 0px !important;
}
Unfortunately, there is still a shifting to left...Can you help? Thank you!
Tom, I fixed it! I added:
.main-navigation .main-nav li.current-menu-ancestor .sub-menu{
left: 0px !important;
}
Thank you so much for your help! Your support is fantastic.!
Glad you got it working :)