ViewTimeline Class

A view progress timeline (https://drafts.csswg.org/scroll-animations-1/#viewtimeline-interface): its current time is the progress of the visibility of a subject in the scrollport of its nearest ancestor scroll container, as a percentage (0% when it starts entering the scrollport, 100% when it has left it).

public sealed class ViewTimeline : ScrollTimeline
Inheritance
ScrollTimeline ViewTimeline

Constructors

NameDescription
ViewTimeline(ViewTimelineOptions)Creates a view timeline of a subject (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-viewtimeline): the timeline belongs to the document of the subject.

ViewTimeline(ViewTimelineOptions)

ViewTimeline.cs

Creates a view timeline of a subject (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-viewtimeline): the timeline belongs to the document of the subject.

public ViewTimeline(ViewTimelineOptions options)

Properties

NameDescription
EndOffsetGets the scroll offset of the 100% position of the timeline, in px from the scroll origin (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-endoffset): 0px when the timeline is inactive.
SourceGets the nearest ancestor scroll container of the subject that is scrollable in the axis of the timeline (https://drafts.csswg.org/scroll-animations-1/#dom-scrolltimeline-source), or null when the subject does not generate a box.
StartOffsetGets the scroll offset of the 0% position of the timeline, in px from the scroll origin (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-startoffset): 0px when the timeline is inactive.
SubjectGets the subject of the timeline (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-subject).

Gets the scroll offset of the 100% position of the timeline, in px from the scroll origin (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-endoffset): 0px when the timeline is inactive.

public CssNumericValue EndOffset { get; }

Gets the nearest ancestor scroll container of the subject that is scrollable in the axis of the timeline (https://drafts.csswg.org/scroll-animations-1/#dom-scrolltimeline-source), or null when the subject does not generate a box.

public override Element? Source { get; }

Property value

Element?

StartOffset

ViewTimeline.cs

Gets the scroll offset of the 0% position of the timeline, in px from the scroll origin (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-startoffset): 0px when the timeline is inactive.

public CssNumericValue StartOffset { get; }

Gets the subject of the timeline (https://drafts.csswg.org/scroll-animations-1/#dom-viewtimeline-subject).

public Element Subject { get; }