Created
February 29, 2012 00:02
-
-
Save parrfolio/1936333 to your computer and use it in GitHub Desktop.
Slide Up/Slide Down Accessible jQuery
This file contains 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
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