Skip to content

Instantly share code, notes, and snippets.

@bombless
Forked from kezabelle/gist:4959657
Created February 15, 2013 10:51
Show Gist options
  • Save bombless/4959677 to your computer and use it in GitHub Desktop.
Save bombless/4959677 to your computer and use it in GitHub Desktop.
/*
* Taken from http://sower.com.au/2011/06/jquery-multilevel-accordion-in-10-lines-of-code/
*/
$(document).ready(function() {
$('.menu li ul').hide();
$('.menu li a').click(
function(evt) {
evt.preventDefault();
evt.stopPropagation();
var openMe = $(this).next();
var mySiblings = $(this).parent().siblings().find('ul');
if (openMe.is(':visible')) {
openMe.slideUp();
} else {
mySiblings.slideUp();
openMe.slideDown();
}
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment