The problem is that it animateautomatically sets the style to overflow: hidden.
You can get around this by overriding the style with the step function:
$('button').click(function() {
$('#container').animate(
{'height': '100px'},
{ step: function() { $(this).css("overflow-y", "scroll") } }
);
});
source
share