Create a gist now

Instantly share code, notes, and snippets.

Embed
Animating an element from a fixed height to "auto" height using jQuery
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);
@leonmarkus

This comment has been minimized.

Show comment
Hide comment
@leonmarkus

leonmarkus Dec 31, 2017

Works like a charm!
I was looking for something like that for hours.. until I find this. Amazing job!

Works like a charm!
I was looking for something like that for hours.. until I find this. Amazing job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment