From Chrome 129, new JavaScript events `scrollSnapChange` and `scrollSnapChanging` enable more precise control over snap targets within scrolling contexts. `scrollSnapChange` fires after the scroll gesture ends and a new snap target is established, while `scrollSnapChanging` fires during the scrolling process when a potential new snap target is determined. These events unlock new possibilities for scroll snap interactions, including animations, linked scrollers, and various UI enhancements.

7m read timeFrom developer.chrome.com
Post cover image
Table of contents
scrollSnapChangescrollSnapChangingUse cases and examplesFurther studies

Sort: