The AnimationEvent() constructor returns a newly created AnimationEvent, representing an event in relation with an animation.


animationEvent = new AnimationEvent(type, {animationName: aPropertyName,
                                           elapsedTime  : aFloat,
                                           pseudoElement: aPseudoElementName});


The AnimationEvent() constructor also inherits arguments from Event().

A DOMString 代表AnimationEvent类型的名称。大小写敏感,有三个值可选:'animationstart', 'animationend', 和 'animationiteration'。
animationName 可选
A DOMString containing the value of the animation-name CSS property associated with the transition. It defaults to "".
elapsedTime 可选
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). It defaults to 0.0.
pseudoElement 可选
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: "". It defaults to ""


Specification Status Comment
CSS Animations Level 1
Working Draft Initial definition.


We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 43.0 23.0 (23.0) 未实现 未实现 未实现
pseudoElement 未实现 23.0 (23.0) 未实现 未实现 未实现
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 未实现 23.0 (23.0) 未实现 未实现 未实现 43.0
pseudoElement 未实现 23.0 (23.0) 未实现 未实现 未实现 未实现