AnimationEvent Class

The event fired by the CSS animations: animationstart, animationiteration, animationend and animationcancel (https://drafts.csswg.org/css-animations-1/#interface-animationevent).

public sealed class AnimationEvent : Event
Inheritance
Event AnimationEvent

Constructors

NameDescription
AnimationEvent(string, AnimationEventInit?)Creates an event of the given type.

AnimationEvent(string, AnimationEventInit?)

AnimationEvent.cs

Creates an event of the given type.

public AnimationEvent(string type, AnimationEventInit? animationEventInitDict = null)

Properties

NameDescription
AnimationGets the animation that generated the event.
AnimationNameGets the name of the animation (the value of animation-name).
ElapsedTimeGets the time the animation has been running, in seconds, excluding the time it was paused.
PseudoElementGets the pseudo-element the animation runs on (e.g. ::before), or the empty string.

Gets the animation that generated the event.

public CssAnimation? Animation { get; }

AnimationName

AnimationEvent.cs

Gets the name of the animation (the value of animation-name).

public string AnimationName { get; }

Gets the time the animation has been running, in seconds, excluding the time it was paused.

public double ElapsedTime { get; }

PseudoElement

AnimationEvent.cs

Gets the pseudo-element the animation runs on (e.g. ::before), or the empty string.

public string PseudoElement { get; }