Window scrollBy () method
Definition and Usage
scrollBy () method is the number of pixels to scroll through the contents specified.
Note: For this method to work window scroll bar must be visible property is set to true!
grammar
scrollBy(xnum,ynum)
parameter | description |
---|---|
xnum | Required. The number of pixels to scroll the document to the right. |
ynum | Required. The number of pixels to scroll down the document. |
Browser Support
All major browsers support scrollBy () method
Examples
Examples
Scroll 100 pixels of content:
function scrollWindow () {
window.scrollBy (100,100);
}
window.scrollBy (100,100);
}
try it"
Window object