Created
September 11, 2013 13:26
-
-
Save anonymous/6523570 to your computer and use it in GitHub Desktop.
Super simple accordion / slide-toggle
This file contains hidden or 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
App.accordion('.accordion','.item'); | |
App.accordion = function(container,item){ | |
var item_selector = container+' '+item; | |
$(item_selector+' .header').css('cursor','pointer'); | |
$(item_selector+' .header').on('click',function(){ | |
$(this).closest(item).find('.body').slideToggle(); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment