DOM:window.scrollBy
From MDC
(Difference between revisions)
| Revision as of 12:38, 7 July 2006 Jabez (Talk | contribs) Parameters � Previous diff |
Current revision Jabez (Talk | contribs) Parameters |
||
| Line 9: | Line 9: | ||
| *<code>X</code> is the offset in pixels to scroll horizontally. | *<code>X</code> is the offset in pixels to scroll horizontally. | ||
| *<code>Y</code> is the offset in pixels to scroll vertically. | *<code>Y</code> 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. | ||
| ==Example == | ==Example == | ||
Current revision
« Gecko DOM Reference
Contents |
[edit]
Summary
Scrolls the document in the window by the given amount.
[edit]
Syntax
window.scrollBy(X,Y)
[edit]
Parameters
Xis the offset in pixels to scroll horizontally.Yis 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.
Categories: Gecko DOM Reference