Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JS animate to auto function
jQuery.fn.animateHeightAuto = function(speed, callback) {
var height;
return this.each(function(i, $element) {
var $this = $( $element );
var heightBackup = $this.css('height');
'height': 'auto'
height = $this.css('height');
'height': heightBackup,
'height': height,
}, speed, callback);
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.