The scrollsnapchange event fires on a scroll container when scrolling ends and a new scroll snap target is selected—just before scrollend. Learn SnapEvent, snapTargetBlock / snapTargetInline, the CSS you need, and five try-it labs.
01
Kind
Instance event
02
Type
SnapEvent
03
When
New snap selected
04
Handler
onscrollsnapchange
05
Status
Experimental
06
Baseline
Limited availability
Fundamentals
Introduction
CSS scroll snap lets a scroller “stick” to child items (carousels, full-page sections, card rails). scrollsnapchange is the JavaScript signal that says: “Scrolling finished, and this child is now the selected snap target.”
It fires on the scroll container at the end of a gesture (touch, scrollbar drag, and similar), and only when a new snap target was chosen. MDN notes it runs just before the matching scrollend event.
💡
Beginner tip
Without CSS snap (scroll-snap-type on the container and scroll-snap-align on children), there is nothing to snap to—and this event will not help you. Style first, then listen.
Concept
Understanding scrollsnapchange
An instance event that answers: “Did scrolling end on a newly selected snap target?”
Trigger — scroll gesture finished and a new snap target was selected.
Event type — SnapEvent with axis target properties.
Timing — at end of scrolling, just before scrollend.
CSS required — scroll snap on the container and children.
Status — Experimental; Limited availability (not Baseline).
CSS First
🎨 Scroll Snap Setup
Turn a box into a snap container and mark children as snap targets:
JavaScript
main {
width: 250px;
height: 450px;
overflow: scroll;
scroll-snap-type: block mandatory;
}
main > section {
scroll-snap-align: start;
}
scrollsnapchange is Experimental and not Baseline on MDN. Logos use the shared browser-image-sprite.png sprite from this project. Expect Chromium-family support; Firefox and Safari generally lack this event.
✓ Experimental · Limited availability
Element scrollsnapchange
Fires when a new scroll snap target is selected at scroll end. Chrome / Edge 129+, Opera 115+; feature-detect elsewhere.
LimitedNot Baseline
Google Chrome129+
Supported
Mozilla FirefoxNot supported
Unavailable
Apple SafariNot supported
Unavailable
Microsoft Edge129+
Supported
Opera115+
Supported
Internet ExplorerNot supported
Unavailable
scrollsnapchangeLimited
Bottom line: Use CSS scroll snap first, listen on the container, read SnapEvent targets, and keep a fallback for browsers without the event.
Wrap Up
Conclusion
scrollsnapchange tells you when a scroll snap container has settled on a new snap target. Pair CSS scroll snap with a SnapEvent listener, style snapTargetBlock / snapTargetInline, and feature-detect because support is still Limited / Experimental.
Set up CSS scroll snap before relying on the event
Listen on the scrolling container, not each child
Null-check snapTargetBlock / snapTargetInline
Feature-detect with "onscrollsnapchange" in window
Prefer addEventListener for multiple handlers
❌ Don’t
Ship to all browsers without a fallback plan
Confuse it with scrollsnapchanging (pending vs selected)
Expect it without scroll-snap-type / scroll-snap-align
Assume Firefox or Safari support yet
Overwrite onscrollsnapchange if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about scrollsnapchange
New snap selected at scroll end—read SnapEvent, then style.
5
Core concepts
📱01
On end
new snap selected
Trigger
📄02
SnapEvent
snapTarget*
API
⇄03
vs changing
pending vs final
Compare
🎨04
CSS first
snap-type + align
Setup
🎯05
Experimental
Chromium today
Status
❓ Frequently Asked Questions
It fires on a scroll container at the end of a scrolling operation when a new scroll snap target has been selected—just before the scrollend event.
MDN marks Element scrollsnapchange as Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard. Support is mainly Chromium-based today.
A SnapEvent, which inherits from Event. Use snapTargetBlock and snapTargetInline to read the newly selected snap targets on each axis.
When the user finishes scrolling in the container—for example after a touch gesture or after dragging the scrollbar—and releases the gesture.
scrollsnapchanging can fire during a gesture when a pending snap target changes. scrollsnapchange fires once at the end when the new snap target is actually selected.
Set scroll-snap-type on the scroll container and scroll-snap-align (often start or center) on child snap targets so the browser has something to snap to.
Did you know?
scrollsnapchanging can fire multiple times while the user is still scrolling over potential targets. scrollsnapchange fires once when the selection is final—better for dots, analytics, and “active card” styling.