Skip to content

Instantly share code, notes, and snippets.

@billkeller
Created November 22, 2010 17:49
Show Gist options
  • Save billkeller/710332 to your computer and use it in GitHub Desktop.
Save billkeller/710332 to your computer and use it in GitHub Desktop.
Basic jQuery .toggle
// Toggle
$('#foo').toggle(function(){
$(this).addClass('active');
$('.bar').slideDown();
$(this).animate({'top' : '-150px'},'slow');
}, function(){
$(this).removeClass('active');
$('.bar').slideUp();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment