scrollend
The scrollend event fires when the document view has completed scrolling. Scrolling is considered completed when the scroll position has no more pending updates and the user has completed their gesture.
Scroll position updates include smooth or instant mouse wheel scrolling, keyboard scrolling, scroll-snap events, or other APIs and gestures which cause the scroll position to update. User gestures like touch panning or trackpad scrolling aren't complete until pointers or keys have released. If the scroll position did not change, then no scrollend event fires.
For detecting when scrolling inside an element is complete, see the scrollend event of Element.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 114 | 114 | 109 | 26.2 | 114 | 26.2 | |
| The scrollend event fires when element scrolling has completed. Scrolling is considered completed when the scroll position has no more pending updates and the user has completed their gesture. | 114 | 114 | 109 | 26.2 | 114 | 26.2 |
Syntax
addEventListener("scrollend", (event) => { })
onscrollend = (event) => { } Use cases
-
Using scrollend
The scrollend event fires when the document view has completed scrolling.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.