The Document scrollsnapchange event fires when a new scroll snap target is selected at the end of a scrolling operation on the document. Learn CSS setup on html, SnapEvent.snapTargetBlock, and five try-it labs.
01
Kind
Document event
02
Type
SnapEvent
03
Means
New snap target
04
Needs
scroll-snap-type on html
05
Key prop
snapTargetBlock
06
Status
Experimental
Fundamentals
Introduction
CSS scroll snap can make sections “lock” into place as the user scrolls—like full-page slides. When the document itself is the snap container and a new target is chosen after scrolling ends, the browser fires scrollsnapchange on the Document.
Unlike plain scroll or scrollend, this event tells you which element became the selected snap target via a SnapEvent.
💡
Beginner tip
For Document scrollsnapchange, set scroll-snap-type on html (MDN). If snap lives on a scrolling <div>, use Element scrollsnapchange instead.
Concept
Understanding Document scrollsnapchange
A Document event that answers: “Did scrolling end with a newly selected snap target on the document container?”
Fires on the document scroll container when a new snap target is selected at the end of scrolling (MDN).
Requires the HTML document as snap container (scroll-snap-type on html).
Event type — SnapEvent (inherits from Event).
Useful properties — event.snapTargetBlock (and snapTargetInline when relevant).
Handler — document.onscrollsnapchange or addEventListener("scrollsnapchange", ...).
Status — Experimental and Limited availability on MDN (not Baseline).
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
SnapEvent extends Event with snap-target references so you can style or announce the newly selected section.
Property
Beginner meaning
snapTargetBlock
Element selected as snap target on the block axis (often vertical)
snapTargetInline
Element selected on the inline axis (often horizontal), when applicable
Compare
⚖️ scrollsnapchange vs scrollend vs scroll
Topic
scroll
scrollend
scrollsnapchange
Meaning
View is scrolling
Scrolling finished
New snap target selected
Needs CSS snap?
No
No
Yes (document snap container)
Event type
Event
Event
SnapEvent
MDN status
Baseline widely
Baseline 2025
Experimental
MDN also documents related scrollsnapchanging (selection in progress). Treat that as a sibling experimental snap event when you need live preview while scrolling.
Document scrollsnapchange is marked Experimental and Limited availability on MDN (not Baseline). Logos use the shared browser-image-sprite.png sprite from this project. Feature-detect and keep CSS snap usable without the event.
✓ Experimental · Limited availability
Document scrollsnapchange
Fires when a new scroll snap target is selected on the document snap container.
LimitedCheck compat
Google ChromeCheck BCD / Chromium scroll snap events
Partial
Mozilla FirefoxLimited / check BCD
Limited
Apple SafariLimited / check BCD
Limited
Microsoft EdgeFollow Chromium (check BCD)
Partial
OperaFollow Chromium behavior
Partial
Internet ExplorerNo scrollsnapchange
Not supported
scrollsnapchangeLimited availability
Bottom line: Set scroll-snap-type on html, listen for scrollsnapchange, read SnapEvent.snapTargetBlock, and feature-detect before production.
Wrap Up
Conclusion
Document scrollsnapchange connects CSS scroll snap to JavaScript: when a new document snap target is selected, you get a SnapEvent with snapTargetBlock. Keep CSS snap as the core UX and use the event as progressive enhancement.
Five things to remember about Document scrollsnapchange
New snap target selected — SnapEvent points to the section.
5
Core concepts
📄01
New target
after scroll ends
Event
🎨02
SnapEvent
snapTargetBlock
API
💻03
CSS on html
scroll-snap-type
Setup
🔍04
Detect
before relying
Compat
⚠️05
Experimental
not Baseline
MDN
❓ Frequently Asked Questions
It fires on the document scroll container at the end of a scrolling operation when a new scroll snap target is selected. The Document must be the scroll snap container (scroll-snap-type set on html).
MDN marks Document scrollsnapchange as Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard. Feature-detect before production use.
A SnapEvent, which inherits from Event. Use event.snapTargetBlock (and snapTargetInline when relevant) to get the newly selected snap target element.
Set scroll-snap-type on the html element (for example scroll-snap-type: block mandatory) and scroll-snap-align on the snap children. MDN’s Document example uses that pattern.
scrollend means scrolling finished. scrollsnapchange means a new snap target was selected at the end of a scrolling operation. You often use both together.
Same idea for an Element that is the scroll snap container (overflow + scroll-snap-type on that element). Document scrollsnapchange is for when the overall document (html) is the snap container.
Did you know?
Scroll snap itself is mostly CSS. Events like scrollsnapchange exist so scripts can react when the browser has already chosen a target—without guessing from raw scrollY math.