Reputation: 2663
I need to do scrolling with JS. I know it can be done on the window with window.scrollBy
or window.scrollTo
, but I haven't been able to find how to get it done inside of an element that has the overflow-y: scroll
css property. Here's a JSBin as an example of what I want to scroll: http://jsbin.com/UcUQul/1/edit
Upvotes: 0
Views: 66
Reputation: 35950
You can use scrollTop
property. For instance:
var outer = document.getElementById('outer');
outer.scrollTop = 10;
See this JSFiddle for an example.
Upvotes: 1