Skip to content

Instantly share code, notes, and snippets.

@agragregra
Last active December 24, 2020 11:13
Show Gist options
  • Save agragregra/3acf488910114ca3a592 to your computer and use it in GitHub Desktop.
Save agragregra/3acf488910114ca3a592 to your computer and use it in GitHub Desktop.
$(".has_submnu").click(function(e) {
e.preventDefault();
if($(this).next().is(":visible")) {
$(".top_mnu li > ul").slideUp();
$(this).next().slideUp();
$(".top_mnu > ul > li").removeClass("active");
$(this).parent().removeClass("active");
} else {
$(".top_mnu li > ul").slideUp();
$(this).next().slideDown();
$(".top_mnu > ul > li").removeClass("active");
$(this).parent().addClass("active");
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment