You can simply animate it by calling the interval:
setInterval(function() {
window.scrollBy(0, 5);
}, 13);
This, of course, will do it again and again, so you need to put a conditional check when you need to cancel the interval. It might look like this:
var timerID = setInterval(function() {
window.scrollBy(0, 5);
if( window.pageYOffset >= 500 )
clearInterval(timerID);
}, 13);
jAndy source
share