W3cubDocs

/DOM

AnimationEvent

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.

AnimationEvent.animationName Read only
Is a DOMString containing the value of the animation-name CSS property associated with the transition.
AnimationEvent.elapsedTime 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, in which case the event will be fired with elapsedTime containing (-1 * delay).
AnimationEvent.pseudoElement Read only
Is a DOMString, 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.

AnimationEvent.initAnimationEvent()
Initializes a AnimationEvent created using the deprecated Document.createEvent("AnimationEvent") method.

Specifications

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

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 43
43
Yes
Prefixed
Prefixed Requires the vendor prefix: webkit
? 6 10 30
Prefixed
30
Prefixed
Prefixed Requires the vendor prefix: webkit
12.1
12
Prefixed
Prefixed Requires the vendor prefix: o
9.1
9.1
4
Prefixed
Prefixed Requires the vendor prefix: webkit
AnimationEvent 43
43
Yes
? 23 No No No
animationName 43
43
Yes
12 6 10 Yes 9
elapsedTime 43 12 6 10 Yes 9
initAnimationEvent 1 12 — 16 6 — 23 10 10 4
pseudoElement 68 No 23 No No No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes
Prefixed
Yes
Prefixed
Prefixed Requires the vendor prefix: webkit
43
43
Yes
Prefixed
Prefixed Requires the vendor prefix: webkit
? 6 30
Prefixed
30
Prefixed
Prefixed Requires the vendor prefix: webkit
12.10
12
Prefixed
Prefixed Requires the vendor prefix: o
?
Prefixed
?
Prefixed
Prefixed Requires the vendor prefix: webkit
4.0
4.0
Yes
Prefixed
Prefixed Requires the vendor prefix: webkit
AnimationEvent 43
43
Yes
43
43
Yes
? 23 No ? 4.0
animationName 43
43
Yes
43
43
Yes
Yes ? ? ? 4.0
elapsedTime Yes 43 Yes 6 Yes Yes 4.0
initAnimationEvent Yes 43 ? 6 — 23 Yes ? 4.0
pseudoElement 68 68 No 23 No No No

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent