창(window
)의 콘텐츠가 스크롤되어지는 경우 발생한다.
요소가 스크롤 될 때 발생한다.
VisualViewport
, 뷰포트(viewport) 또는 Element
가 각각 스크롤이 될 때 VisualViewport
, Document
또는 요소에서 발생한다.
스크롤이 완료된 시점에 대한 이벤트는 scrollend
이다.
window.addEventListener("scroll", function() { });
type | scroll |
---|---|
bubbles | no |
cancelable | no |
target | Element |
handler | onscroll |