initAnimationEvent method
Initializes the values of an animation event.
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() |
Syntax
var retval = AnimationEvent.initAnimationEvent(typeArg, canBubbleArg, cancelableArg, animationNameArg, elapsedTimeArg);Parameters
- typeArg [in]
-
Type: DOMString
A string that specifies the event type
Value Meaning - animationStart
Occurs at the start of an animation.
- animationEnd
Occurs when the animation is finished.
- animationIteration
Occurs at the end of an animation, when animation-iteration-count is greater than 1.
- canBubbleArg [in]
-
Type: boolean
Specifies whether an event bubbles.
Value Meaning - true
The event bubbles.
- false
The event does not bubble.
- cancelableArg [in]
-
Type: boolean
Specifies whether an event can be canceled.
Value Meaning - true
The event can be canceled.
- false
The event cannot be canceled.
- animationNameArg [in]
-
Type: DOMString
A string identifying the name of the animation.
- elapsedTimeArg [in]
-
Type: Floating-point
A number indicating the amount of time the animation has been running, in seconds.
Return value
Type: HRESULT
This method can return one of these values.
- S_OK
Remarks
Call initAnimationEvent method before dispatching the event; otherwise, it has no effect.
Use document.createEvent to create an event and dispatchEvent to dispatch it to the target object.
See also
