Table of contents
AnimationEvent objects provide information about events that occur related to CSS animations.
Method overview
void initAnimationEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString propertyNameArg, in float elapsedTimeArg); |
Attributes
| Attribute | Type | Description |
animationName | DOMString | The name of the animation on which the animation event occurred. |
elapsedTime | float | The amount of time, in seconds, the animation had been running at the time the event occurred. |
Methods
initAnimationEvent()
Initializes the animation event.
void initAnimationEvent( in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString propertyNameArg, in float elapsedTimeArg );
Parameters
typeArg- A string identifying the specific type of animation event that occurred. See Animation event types below for details.
canBubbleArgtrueof the event can bubble, otherwisefalse.cancelableArgtrueif the event's default action can be prevented; otherwisefalse.animationNameArg- The name of the animation that generated the event; this is the same as the value of the
animation-nameproperty on the element that's animating. elapsedTimeArg- The amount of time, in seconds, since the animation began, at which the event was created.
Animation event types
The following types of events can be fired by CSS animations; these strings are the possible values of the event.type
value on the delivered event.
animationstart- Sent when the animation begins. The
elapsedTimeattribute's value will be 0. animationend- Sent when the animation ends.
animationiteration- Sent at the end of each iteration of an animation for which
animation-iteration-countis greater than one; this event isn't fired for animations with an iteration count of one.
All of these events can be canceled, and can bubble.
Mozilla Developer Network