Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Animating an element from a fixed height to "auto" height using jQuery
var $selector = $('div');
$'oHeight',$selector.height()).css('height','auto').data('nHeight',$selector.height()).height($'oHeight')).animate({height: $'nHeight')},400);

This comment has been minimized.

Copy link

@leonmarkus leonmarkus commented Dec 31, 2017

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
You can’t perform that action at this time.