Skip to content

Instantly share code, notes, and snippets.

@jessehs
Created December 17, 2013 01:22
Show Gist options
  • Save jessehs/7998333 to your computer and use it in GitHub Desktop.
Save jessehs/7998333 to your computer and use it in GitHub Desktop.
$('.megamenu-parent-title > a').click(function(e) {
// Don't follow the link.
e.preventDefault();
e.stopPropagation();
// Make top level links open/close the megamenu.
if ($(this).parent('li.megamenu-parent').hasClass('hover')) {
// This menu is already open. Close it.
megamenu_close();
}
else {
megamenu_open();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment