views:

277

answers:

1

Hi, does anyone know how to automatically jump to the bottom of a scrollable area by event in jquery ( or even javascript if no easy jquery solution)?

regards

+1  A: 
<div id="myDiv" style="height:300px;overflow:auto;">
    <p>my content here</p>
</div>

var myDiv = $("#myDiv");
myDiv.animate({ scrollTop: myDiv.attr("scrollHeight") - myDiv.height() }, 3000);
PetersenDidIt
right on the money!
Phil Jackson