Skip to content

Instantly share code, notes, and snippets.

@parrfolio
Created February 29, 2012 00:02
Show Gist options
  • Save parrfolio/1936333 to your computer and use it in GitHub Desktop.
Save parrfolio/1936333 to your computer and use it in GitHub Desktop.
Slide Up/Slide Down Accessible jQuery
var $button = $('#myButton'),
$text = $('#myText'),
visible = true;
$button.click(function(){
if ( visible ) {
$text.slideUp('fast',function(){
$text.addClass('hide')
.slideDown(0);
});
} else {
$text.slideUp(0,function(){
$text.removeClass('hide')
.slideDown('fast');
});
}
visible = ! visible;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment