AnimationEvent object
Provides contextual information associated with animation events.
![]() |
DOM Information
Inheritance Hierarchy
Members
The AnimationEvent object has these types of members:
Events
The AnimationEvent object has these events.
| Event | Description |
|---|---|
| animationend |
The animationend event occurs when the animation finishes. |
| animationiteration |
The animationiteration event occurs at the end of each iteration of an animation. This event only occurs when the animation-iteration-count property is greater than one. |
| animationstart |
The animationstart event occurs at the beginning of the animation, accounting for any animation delay (as specified by the animation-delay property), if necessary. |
Methods
The AnimationEvent object has these methods.
| Method | Description |
|---|---|
| initAnimationEvent |
Initializes the values of an animation event. |
Properties
The AnimationEvent object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read-only |
The name of a keyframe rule that defines the style rules applied by the animation. | |
|
Read-only |
The amount of time the animation has been running, in seconds. |
Remarks
AnimationEvent objects provide information about events that occur related to Cascading Style Sheets (CSS) animations. Several animation related events are available. For example, the start and end of an animation, and the end of each iteration of an animation all generate Document Object Model (DOM) events. An element can have multiple properties being animated simultaneously. This can occur either with a single animationName value with keyframes containing multiple properties, or with multiple animationName values. For the purposes of events, each animationName specifies a single animation. Therefore an event will be generated for each animationName value and not necessarily for each property being animated. The time the animation has been running is sent with each event generated. This allows the event handler to determine the current iteration of a looping animation or the current position of an alternating animation. This time does not include any time the animation was in the paused play state.
See also
