We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


Scrolls the document in the window by the given amount.


window.scrollBy(X, Y);


  • X is the offset in pixels to scroll horizontally.
  • Y is the offset in pixels to scroll vertically.

Positive co-ordinates will scroll to the right and down the page. Negative values will scroll to the left and up the page.


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


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 Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'window.scrollBy()' in that specification.
Working Draft Initial definition.

Document Tags and Contributors

 Last updated by: cvrebert,