jquery - Sub menu slides up then back down if it is already down selected (bug) -
hello having problem jquery vertical accordion style menu.
if click sub menu, drops down. if click on different sub menu, current 1 slides , 1 clicked slides down.
i using .slideup()
jquery function default sub menus position before sliding next 1 down.
the problem when click on sub menu, drops down, click on same sub menu, slides , slides down again.
how can prevent happening? instead want submenu slide if down.
please see jsfiddle: http://jsfiddle.net/o5w37zva/
your problem in selector. use below selector slideup others submenus , slides submenus in nav.
$("#nav ul")
if use selector, need modify .not() function , remove current,$(this) element in function.
$("#nav ul").not($(".submenu-customers")).slideup();
with selector, if user click opened submenu, slideup only. can see demo: http://codepen.io/ogzhncrt/pen/bdypbk
Comments
Post a Comment