[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/API/Window/scroll [Back]  [Original]

Window.scroll() - Web API | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Window.scroll()

Baseline Widely available *

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

* Some parts of this feature may have varying levels of support.

Window.scroll() .

In this article

js
scroll(x-coord, y-coord)
scroll(options)

  • x-coord .
  • y-coord .

- -

options

.

top

Y .

left

X .

behavior

.

(undefined).

html
<!-- put the 100th vertical pixel at the top of the window -->

<button >click to scroll to the 100th pixel</button>

options :

js
window.scroll({
  top: 100,
  left: 100,
  behavior: "smooth",
});

Window.scrollTo() . Window.scrollBy(), Window.scrollByLines() Window.scrollByPages() .

, Element.scrollTop Element.scrollLeft .

Specification
CSSOM View Module
# dom-window-scroll


Web Proxy Viewer  |  New URL  |  Original Page