이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!
Summary
Scrolls the document in the window by the given amount.
Syntax
window.scrollBy(X, Y);
Parameters
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.
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
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'window.scrollBy()' in that specification. |
Working Draft | Initial definition. |