Skip to content

Instantly share code, notes, and snippets.

@erickarbe
Created February 13, 2013 02:51
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erickarbe/4932027 to your computer and use it in GitHub Desktop.
Save erickarbe/4932027 to your computer and use it in GitHub Desktop.
Easy jQuery Accordion Functionality for RWD Navigation
var menu = $j('#menu'),
menulink = $j('.menu-link'),
menuTrigger = $j('.has-submenu > a');
menulink.click(function(e) {
e.preventDefault();
menulink.toggleClass('active');
menu.toggleClass('active');
});
menuTrigger.click(function(e) {
e.preventDefault();
$j(this).toggleClass('active').next('ul').toggleClass('active');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment