Skip to content

Instantly share code, notes, and snippets.

@WebEndevSnippets
Created October 20, 2012 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WebEndevSnippets/3924278 to your computer and use it in GitHub Desktop.
Save WebEndevSnippets/3924278 to your computer and use it in GitHub Desktop.
JavaScript: jQuery Toggle
/**** Toggle ****/
$('.toggle').next('.toggle-content').hide();
$('.toggle').click(function() {
$('.active').not(this).toggleClass('active').next('.toggle-content').slideToggle('slow');
$(this).toggleClass('active').next().slideToggle('slow');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment