TOC PREV NEXT INDEX

Put your logo here!


window.scrollBy()


Scrolls the document in the window by the given amount.

Syntax

window.scrollBy(xDelta, yDelta) 

Parameters

xDelta is the amount of pixels to scroll horizontally.

yDelta is the amount of pixels to scroll vertically.

Example

// scroll one page 
window.scrollBy(0, window.innerHeight); 

Notes

window.scrollBy() scrolls by a particular amount where window.scroll() scrolls to an absolute position in the document.

See also window.scrollByLines(), window.scrollByPages()

Specification

DOM Level 0. Not part of specification. 


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX