The Window.scrollTo() method scrolls to a particular set of coordinates in the document.
The Window.scrollTo()
and Window.scroll()
methods scroll to a particular set of coordinates in the document.
Syntax
window.scrollTo(x-coord, y-coord)
window.scrollTo(options)
window.scroll(x-coord, y-coord)
window.scroll(options)
Parameters
x-coord
is the pixel along the horizontal axis of the document that you want displayed in the upper left.y-coord
is the pixel along the vertical axis of the document that you want displayed in the upper left.options
is aScrollToOptions
dictionary.
Examples
window.scrollTo(0, 1000);
window.scrollTo(0, -1000);
window.scroll(0, 1000);
window.scroll(0, -1000);