The scrollsnapchanging event fires on a scroll container when a pending snap target changes during a gesture. Learn SnapEvent, how it differs from scrollsnapchange, CSS scroll snap setup, and five try-it labs.
01
Kind
Instance event
02
Type
SnapEvent
03
When
Pending snap changes
04
Handler
onscrollsnapchanging
05
Status
Experimental
06
Baseline
Limited availability
Fundamentals
Introduction
While the user is still scrolling a snap container, the browser may decide which child would become the snap target if the gesture ended now. That child is the pending snap target. scrollsnapchanging reports it.
It fires during the gesture (touch drag, scrollbar drag, and similar), and can fire multiple times as the pending target changes. MDN notes it does not fire for every snap child you pass—only for the last target the snap would potentially rest on.
💡
Beginner tip
Think of scrollsnapchanging as a live preview (“about to land here”) and scrollsnapchange as the final selection after the gesture ends.
Concept
Understanding scrollsnapchanging
An instance event that answers: “Which snap target is currently pending during this gesture?”
Trigger — pending snap target changes while scrolling.
Event type — SnapEvent with axis target properties.
Timing — during the gesture (can fire multiple times).
Not every child — only the potential rest target, not each crossed one.
Status — Experimental; Limited availability (not Baseline).
CSS First
🎨 Scroll Snap Setup
Same CSS foundation as other scroll snap events:
JavaScript
main {
width: 250px;
height: 450px;
overflow: scroll;
scroll-snap-type: block mandatory;
}
main > section {
scroll-snap-align: start;
}
scroll-snap-type on the scrolling container.
scroll-snap-align on each snap child.
Listen for scrollsnapchanging on that same container.
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
scrollsnapchanging 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 scrollsnapchanging
Fires when a pending scroll snap target changes during a gesture. 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
scrollsnapchangingLimited
Bottom line: Use CSS scroll snap first, style the pending SnapEvent target during the gesture, then commit with scrollsnapchange.
Wrap Up
Conclusion
scrollsnapchanging is the live “pending snap” signal during a scroll gesture. Style snapTargetBlock / snapTargetInline for previews, then use scrollsnapchange when the selection commits.
Set up CSS scroll snap before relying on the event
Clear previous pending styles on each update
Null-check snapTargetBlock / snapTargetInline
Use scrollsnapchange for committed UI / analytics
Feature-detect with "onscrollsnapchanging" in window
❌ Don’t
Treat pending previews as final selection
Assume it fires for every snap child you scroll past
Ship without a fallback outside Chromium
Skip CSS scroll-snap-type / scroll-snap-align
Overwrite onscrollsnapchanging if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about scrollsnapchanging
Pending snap during the gesture—preview now, commit later.
5
Core concepts
📱01
During
pending snap
Trigger
📄02
SnapEvent
snapTarget*
API
⇄03
vs change
pending vs final
Compare
📈04
Multi-fire
per gesture
Behavior
🎯05
Experimental
Chromium today
Status
❓ Frequently Asked Questions
It fires on a scroll container during a scrolling gesture when the browser decides a new snap target is pending—the one that will be selected when the gesture ends.
MDN marks Element scrollsnapchanging 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 pending snap targets on each axis.
Yes. It can fire multiple times as the user moves over potential snap targets. It does not fire for every crossed target—only for the last target the snap would potentially rest on.
scrollsnapchanging reports the pending target during the gesture. scrollsnapchange fires at the end when a new snap target is actually selected (just before scrollend).
Set scroll-snap-type on the scroll container and scroll-snap-align on child snap targets so the browser has something to snap to.
Did you know?
Even if you scroll across several snap cards in one drag, scrollsnapchanging only reports the target the browser would rest on now—not every intermediate card you passed.