Archived topic
Drop-down menu doesn't work the same in 2.0.1
12 replies · Started by Daren on January 9, 2018
Hi Tom and Leo,
When I updated to 2.0.1 today my drop-down menu stopped working the way it used to. I had it just like you do here on your site for the Help drop down when you click (mine is on hover) and the top of the sub-menu is flush with the bottom of the header section. Only now when I hover it still appears as expected but when I move the cursor down to select a submenu item it disappears before I get there. I have since reverted back to 1.4 and it now works as before. What can I do to make it work in 2.0.1?
Thanks,
Daren
Hi there,
A bit hard to tell without seeing the issue live unfortunately.
Can you give this CSS a shot? https://generatepress.com/forums/topic/hover-on-the-main-menu-does-not-work/#post-442646
Should I update to 2.0.1 again and send a link?
Yes if you can duplicate the issue on a staging site it will definitely help :)
Thanks!
Here it is: http://holdtrade.darenjm.com/
Thanks Leo
Instead of using margin-top, try padding-top.
.main-nav ul {
padding-top: 18px;
}
Thanks Tom, I'll give it a try.
That was it. Why did margin work before the update and not after?
The old menu used javascript and had a timer on it so the menu wouldn't disappear for a half second after the mouse left the menu item. So actually if you were slow with your mouse, the same issue would have happened.
The new menu uses pure CSS which has no such timer.
So margin separated the ul creating a gap whereas padding does not.
That's right, margin is outside the element which causes blank space, whereas padding is inside the element.
Thanks again Tom, appreciate the help on this.
You're welcome :)