HTML onscrollsnapchanging Event Attribute
Description
The onscrollsnapchanging event attribute runs a script on a scroll snap container when the browser picks a new pending snap target during a scroll. It fires while the user is still scrolling, as soon as the element that will be snapped to changes, so the page can give immediate feedback.
Like onscrollsnapchange, the event is a SnapEvent with the properties snapTargetBlock and snapTargetInline. The pending target can still change before the scroll ends, so use scrollsnapchange for actions that should only happen once the scroll has settled.
Syntax
<element onscrollsnapchanging="script">
Values
- scriptThe name of the script to use when the event has been triggered.
Example
Browser Support
The following information will show you the current browser support for the HTML onscrollsnapchanging event attribute. Hover over a browser icon to see the version that first introduced support for this HTML event attribute.
Desktop





Tablets & Mobile





