SnapEvent Class
The event fired at a scroll snap container (or at the document for the viewport) when the snap targets it snaps to change (scrollsnapchanging, when a scroll operation starts) or changed (scrollsnapchange, when a scroll operation is completed or after a layout change) (https://drafts.csswg.org/css-scroll-snap-2/#snap-events).
public sealed class SnapEvent : Event- Inheritance
EventSnapEvent
Constructors
| Name | Description |
|---|---|
| SnapEvent(string, SnapEventInit?) | Creates an event with the given type and initialization dictionary. |
SnapEvent(string, SnapEventInit?)
SnapEvent.csCreates an event with the given type and initialization dictionary.
public SnapEvent(string type, SnapEventInit? eventInitDict = null)Properties
| Name | Description |
|---|---|
| SnapTargetBlock | Gets the element the snap container is snapped to in the block axis (the element of a pseudo-element), or null when it is not snapped in that axis (https://drafts.csswg.org/css-scroll-snap-2/#dom-snapevent-snaptargetblock). |
| SnapTargetInline | Gets the element the snap container is snapped to in the inline axis (https://drafts.csswg.org/css-scroll-snap-2/#dom-snapevent-snaptargetinline): see SnapEvent.SnapTargetBlock. |
SnapTargetBlock
SnapEvent.csGets the element the snap container is snapped to in the block axis (the element of a pseudo-element), or null when it is not snapped in that axis (https://drafts.csswg.org/css-scroll-snap-2/#dom-snapevent-snaptargetblock).
public Node? SnapTargetBlock { get; }Property value
See also
SnapTargetInline
SnapEvent.csGets the element the snap container is snapped to in the inline axis (https://drafts.csswg.org/css-scroll-snap-2/#dom-snapevent-snaptargetinline): see SnapEvent.SnapTargetBlock.
public Node? SnapTargetInline { get; }