Skip to content

Instantly share code, notes, and snippets.

@sms420
Created April 2, 2010 22:17
Show Gist options
  • Save sms420/353801 to your computer and use it in GitHub Desktop.
Save sms420/353801 to your computer and use it in GitHub Desktop.
jQuery Toggle List
//jquery.toggle.list.js
jQuery(document).ready(function() {
// hide all of the elements with a class of 'toggle'
jQuery('.toggle').hide();
// clicking .toggleLink element will show the
// child elements with the class of .toggle
jQuery('a.toggleLink').click(function() {
jQuery(this).parent().next('.toggle').toggle('slow');
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment