Adam Argyle on Nostr: A ✨first look✨ at `snapChanged` in Chrome Canary ```js ...
A ✨first look✨ at `snapChanged` in Chrome Canary
```js
document.addEventListener('snapchanged', e => {
console.log('changed', e.snapTargets)
})
```
get notified when a snap scroller has changed the snap item, and access the node with `event.snapTargets` 🤓
Snap 2 CSS spec draft https://drafts.csswg.org/css-scroll-snap-2/#snap-events
```js
document.addEventListener('snapchanged', e => {
console.log('changed', e.snapTargets)
})
```
get notified when a snap scroller has changed the snap item, and access the node with `event.snapTargets` 🤓
Snap 2 CSS spec draft https://drafts.csswg.org/css-scroll-snap-2/#snap-events