I'll put an example here using Jquery
and animação
, which shows the content "rolling" as if someone were actually scrolling the mouse.
The magic comes from jquery, and the call is:
$('#divQueQueroScrollar').stop().animate({
scrollTop: $('#divQueQueroScrollar')[0].scrollHeight
}, 1500);
The 1500
is the speed of the animation, being milissegundos
, that is, a second and a half.
Follow the executable snippet to see how it looks:
$('#divQueQueroScrollar').stop().animate({
scrollTop: $('#divQueQueroScrollar')[0].scrollHeight
}, 1500);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divid="divQueQueroScrollar" style="border: solid 1px #000; width: 100px; text-align: center; overflow: scroll; height: 100px; ">
1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/>10<br/>11<br/>12<br/>13<br/>14<br/>15<br/>16<br/>17<br/>18<br/>19<br/>20<br/>21<br/>22<br/>23<br/>24<br/>25<br/>26<br/>27<br/>28<br/>29<br/>30<br/>
</div>