scroll
Summary
Causes the window to scroll to the specified x- and y-offset at the upper-left corner of the window.
Method of dom/Windowdom/Window
Syntax
window.scroll(/* see parameter list */);
Parameters
x
- Data-type
- Number
Integer that specifies the horizontal scroll offset, in pixels.
y
- Data-type
- Number
Integer that specifies the vertical scroll offset, in pixels.
Return Value
No return value
Examples
<!-- put the 100th vertical pixel at the top of the window -->
<button onClick="scroll(0, 100);">click to scroll down 100 pixels</button>
Notes
Remarks
This method is provided for backward compatibility only. The recommended way to scroll a window is to use the scrollTo method.
Attributions
Mozilla Developer Network : [scroll Article]
Microsoft Developer Network: [scroll Method Article]