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 that generated the animation.
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 compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
AnimationEvent
Experimental
Chrome Full support 43
Full support 43
No support 1 — 70
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Edge Full support 12Firefox Full support 6IE Full support 10Opera Full support 30
Full support 30
No support 15 — 57
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
No support 12.1 — 15
Full support 12
Prefixed
Prefixed Implemented with the vendor prefix: o
Safari Full support 9.1
Full support 9.1
Full support 4
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
WebView Android Full support 43
Full support 43
No support 1 — 70
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Chrome Android Full support 43
Full support 43
No support 18 — 70
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Firefox Android Full support 6Opera Android Full support 30
Full support 30
No support 14 — 49
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
No support 12.1 — 14
Full support 12
Prefixed
Prefixed Implemented with the vendor prefix: o
Safari iOS Full support 9.3
Full support 9.3
Full support 3.2
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Samsung Internet Android Full support 4.0
Full support 4.0
No support 1.0 — 10.0
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
AnimationEvent() constructor
Experimental
Chrome Full support 43Edge Full support ≤79Firefox Full support 23IE No support NoOpera No support NoSafari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android Full support 23Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 4.0
animationName
Experimental
Chrome Full support 43Edge Full support 12Firefox Full support 6IE Full support 10Opera Full support 30Safari Full support 9WebView Android Full support 43Chrome Android Full support 43Firefox Android Full support 6Opera Android Full support 30Safari iOS Full support 9Samsung Internet Android Full support 4.0
elapsedTime
Experimental
Chrome Full support 43Edge Full support 12Firefox Full support 6IE Full support 10Opera Full support 30Safari Full support 9WebView Android Full support 43Chrome Android Full support 43Firefox Android Full support 6Opera Android Full support 30Safari iOS Full support 9Samsung Internet Android Full support 4.0
initAnimationEvent
ExperimentalDeprecatedNon-standard
Chrome No support 1 — 18
Alternate Name
No support 1 — 18
Alternate Name
Alternate Name Uses the non-standard name: initWebKitAnimationEvent
Edge No support 12 — 16Firefox No support 6 — 23IE Full support 10Opera No support 12.1 — 15Safari No support 4 — 6
Alternate Name
No support 4 — 6
Alternate Name
Alternate Name Uses the non-standard name: initWebKitAnimationEvent
WebView Android No support NoChrome Android No support NoFirefox Android No support 6 — 23Opera Android No support 12.1 — 14Safari iOS No support 3.2 — 6
Alternate Name
No support 3.2 — 6
Alternate Name
Alternate Name Uses the non-standard name: initWebKitAnimationEvent
Samsung Internet Android No support No
pseudoElement
Experimental
Chrome Full support 68Edge Full support 79Firefox Full support 23IE No support NoOpera No support NoSafari No support NoWebView Android Full support 68Chrome Android Full support 68Firefox Android Full support 23Opera Android No support NoSafari iOS No support NoSamsung Internet Android Full support 10.0

Legend

Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
Uses a non-standard name.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also