Reputation: 5098
Im doing this to scroll to a certain position:
window.scrollTo(0, scrollPos);
But it jumps up immediately. How do I make it scroll slowly?
I tried:
$('body').animate({
scrollTo: scrollPos,
}, 1500);
but still jumps up
Upvotes: 0
Views: 57
Reputation: 78006
The property you want is scrollTop
$('body').animate({
scrollTop: scrollPos,
}, 1500);
Demo: http://jsfiddle.net/seancannon/SELJZ/
Upvotes: 1