Category:AJAX - MDC, Category:Functions:Frozen - MDC, Category:RbXPCOM - MDC, Create an account or log in - MDC, Login required to edit - Edit - MDC, Login required to edit - Edit - MDC, Categories - MDC, Category:Web Development - MDC, Create an account or log in - MDC, XBL - MDC

DOM:window.scrollBy

From MDC

« Gecko DOM Reference

Contents

[edit]

Summary

Scrolls the document in the window by the given amount.

[edit]

Syntax

window.scrollBy(X,Y)
[edit]

Parameters

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

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

[edit]

Example

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

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

[edit]

Specification

DOM Level 0. Not part of specification.

Retrieved from "http://developer.mozilla.org/en/docs/DOM:window.scrollBy"