jquery close navigation submenu when click away
$(document).ready(function () { $(".navbar-sub-opener").click(function (evt) { //close submenu when click away - part 2 evt.stopPropagation(); //hide all submenus $(".navbar-sub").hide(); //only open the one that's immediate inside the clicked parent menu item $(this).next($(".navbar-sub")).show(); }); //close submenu when click away - part 1 $('html').click(function () { $(".navbar-sub").hide(); }); });
No comments:
Post a Comment