Warning:
This wiki has been archived and is now read-only.
Scroll
WebApps ⇨ DOM3Events ⇨ Scroll
The scroll event allows authors to capture and act on user-generated scrolling of a document view or an element.
Use Cases and Requirements
The scroll event must be available from a variety of devices:
- scrollbars (buttons, bar, or thumb)
- keys (arrow keys, pageup/pagedown, home/end)
- the default action of the mousewheel event
- script generated scroll event
It must include vertical and horizontal movement, and a combination of both (so you don't get a "stairstep" effect for diagonal movement).
The author must be able to find the current value of the scrolling operation, and should be able to find the delta. Currently, this is only available via the window.scrollX/scrollY
or window.pageXOffset/pageYOffset
properties, not directly from the event.
Optionally, the event may indicate how the scroll event was generated.
Optionally, the event may indicate one of a number of modes: scrollEvent.mode="line | pixel | page | screen"
.