Created
March 12, 2012 16:24
-
-
Save timhettler/2023150 to your computer and use it in GitHub Desktop.
Animating an element from a fixed height to "auto" height using 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 $selector = $('div'); | |
$selector.data('oHeight',$selector.height()).css('height','auto').data('nHeight',$selector.height()).height($selector.data('oHeight')).animate({height: $selector.data('nHeight')},400); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works like a charm!
I was looking for something like that for hours.. until I find this. Amazing job!