-
-
Save bombless/4959677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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