marioloncarek / megamenu-js

Last responsive megamenu you'll ever need
MIT License
360 stars 115 forks source link

Dropdown bug #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi Mario, So when a user clicks to open a few submenus but then resizes the window, the dropdowns remain open one on top of the other, and there is a weird flicker and backwards behaviour.

Any idea why? Attached a .gif so you can see what I mean.

Would appreciate an answer. Thank you. megamenu-dropdown-bug

marioloncarek commented 8 years ago

Let me look at this today and bring you soutluon. Thanks for using megamenu.js!

ghost commented 8 years ago

Thank you for answering, sir. And quite hopeful that we can fix this little bug.

Thanks!

marioloncarek commented 8 years ago

Hello friend! A simple on resize event is all you need for this fix :

$(window).resize(function() {
  $(".menu > ul > li").children("ul").hide();
  $(".menu > ul").removeClass('show-on-mobile');
});

And working demo is at: http://codepen.io/riogrande/pen/gMMdRa

Please, let me know if you have any more questions before i close! Thanks

ghost commented 8 years ago

It works! Perfect. Thank you so much, sir. You can close it now.

jshepdevelopment commented 8 years ago

This solution is working. Thanks!

marioloncarek commented 8 years ago

No problem m8s