$('#first').animate({ height: $('#first').get(0).scrollHeight }, 1000, function(){ $(this).height('auto'); });