i have dropdown menu on click needs trigger overlayer bring focus on dropdown menu. have 2 dropdown menus, reason can't use normal toggleclass(), found solution , if condition find if overlay showed
everything works fine, have problem, if user double click on li.dropdown, solution doesn't work anymore :(
how can hide overlayer if user double click on li.dropdown?
this codepen > https://codepen.io/mp1985/pen/krbodb
$('li.dropdown').click(function() { if (!$('.full-overlayer').hasclass('show')){ $(".full-overlayer").toggleclass("show"); } }); $('.full-overlayer, .dropdown-menu a').click(function() { $('.full-overlayer').removeclass('show'); });
i not sure if best solution approach task.
any suggestion or advice?
maybe found solution works. added if condition check if has class "open"
if ($(this).hasclass('open')) { $(".full-overlayer").removeclass("show"); }
i testing now, seems work, or @ least hope
here codepen if need future > https://codepen.io/mp1985/pen/kxjoan
Comments
Post a Comment