scrollBy
Summary
Causes the window to scroll relative to the current scrolled position by the specified x- and y-pixel offset.
Method of dom/Windowdom/Window
Syntax
window.scrollBy(/* see parameter list */);
Parameters
x
- Data-type
- Number
Integer that specifies the horizontal scroll offset, in pixels. Positive values scroll the window right, and negative values scroll it left.
y
- Data-type
- Number
Integer that specifies the vertical scroll offset, in pixels. Positive values scroll the window down, and negative values scroll it up.
Return Value
No return value
Examples
// scroll one page
window.scrollBy(0, window.innerHeight);
Syntax
Standards information
There are no standards that apply here.
Attributions
Mozilla Developer Network : [scrollBy Article]
Microsoft Developer Network: [scrollBy Method Article]