AnimationEvent

Experimental

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The AnimationEvent interface represents events providing information related to animations.

Constructor

AnimationEvent()
Creates an AnimationEvent event with the given parameters.

Properties

Also inherits properties from its parent Event (en-US).

AnimationEvent.animationName (en-US) Read only
Is a DOMString (en-US) containing the value of the animation-name (en-US) CSS property associated with the transition.
AnimationEvent.elapsedTime (en-US) Read only
Is a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. For an animationstart event, elapsedTime is 0.0 unless there was a negative value for animation-delay (en-US), in which case the event will be fired with elapsedTime containing (-1 * delay).
AnimationEvent.pseudoElement (en-US) Read only
Is a DOMString (en-US), starting with '::', containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: ''.

Methods

Also inherits methods from its parent Event (en-US).

AnimationEvent.initAnimationEvent() (en-US) This API has not been standardized. This deprecated API should no longer be used, but will probably still work.
Initializes a AnimationEvent created using the deprecated Document.createEvent("AnimationEvent") (en-US) method.

Specifications

Specification Status Comment
CSS Animations Level 1
The definition of 'AnimationEvent' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also