Skip to content

Instantly share code, notes, and snippets.

@chillbits-legacy
Created November 22, 2016 09:18
Show Gist options
  • Select an option

  • Save chillbits-legacy/af7b248e8a495a54fe7ecd188989df7d to your computer and use it in GitHub Desktop.

Select an option

Save chillbits-legacy/af7b248e8a495a54fe7ecd188989df7d to your computer and use it in GitHub Desktop.
Sub-menu jquery on mobile
$(".footer-mobile-menu li#submenu-mn").click(function(){
if ($(".bottom-mobmenu-container").hasClass("expanded")) {
$(".bottom-mobmenu-container.expanded").removeClass("expanded").slideUp(350);
$(this).removeClass("openz");
} else {
$(".bottom-mobmenu-container").addClass("expanded").slideDown(350);
$(this).addClass("openz");
}
});
$("#bottom-menu-mobile > li.menu-item-has-children").click(function(){
var theSubMenu = $(this).find(".sub-menu");
if(theSubMenu.hasClass("open")) {
closeTheMenu(theSubMenu);
return;
}
closeTheMenu($(".sub-menu.expanded"));
openTheMenu(theSubMenu);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment