Skip to content

Snap Events #333

Open
Open

Description

@DavMila

WebKittens

No response

Title of the spec

CSS Scroll Snap 2

URL to the spec

https://drafts.csswg.org/css-scroll-snap-2/#snap-events

URL to the spec's repository

https://github.com/w3c/csswg-drafts/tree/main/css-scroll-snap-2

Issue Tracker URL

No response

Explainer URL

No response

TAG Design Review URL

w3ctag/design-reviews#943

Mozilla standards-positions issue URL

mozilla/standards-positions#1008

WebKit Bugzilla URL

No response

Radar URL

No response

Description

CSS scroll snap points are often used as a mechanism to create scroll interactive "selection" components, giving authors control over what areas of its content a scrolling container can settle.This proposal adds 2 JavaScript events, snapchanging, and snapchanged, which fire in response to the scrolling/snapping of containers which snap.

snapchanging (explainer) is a JavaScript event that aims to let the web page know, as early as possible, that a scrolling operation will result in a change in the element the container being scrolled is snapped to.
snapchanged (explainer) is a JavaScript event that fires when a scrolling operation is complete and the scroller has snapped to a different element than it was previously snapped to.

Activity

  1. jpzwarte commented on Oct 10, 2024

    @jpzwarte

    I just used these events to create a swipeable calendar: https://fosstodon.org/@jpzwarte/113283104049508270

    I plan on using IntersectionObserver to get it working in FF and Safari (for now). But these events really make life for web devs easier. Ping? @smfr @annevk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions