AnimationEvent.initAnimationEvent()
The AnimationEvent.initAnimationEvent()
method Initializes an animation event created using the deprecated Document.createEvent("AnimationEvent")
method.
AnimationEvent
created this way are untrusted.
備註: During the standardization process, this method was removed from the specification. It has been deprecated and is in the progress of being removed from most implementations. Do not use this method; instead, use the standard constructor, AnimationEvent()
, to create a synthetic AnimationEvent
.
Syntax
animationEvent.initAnimationEvent(typeArg, canBubbleArg, cancelableArg, animationNameArg, elapsedTimeArg);
Parameters
typeArg
-
A
DOMString
identifying the specific type of animation event that occurred. The following values are allowed:Value Meaning animationstart
The animation has started. animationend
The animation completed. animationiteration
The current iteration just completed. canBubbleArg
-
A
Boolean
(en-US) flag indicating if the event can bubble (true
) or not (false)
. cancelableArg
-
A
Boolean
(en-US) flag indicating if the event associated action can be avoided (true
) or not (false)
. animationNameArg
-
A
DOMString
containing the value of theanimation-name
(en-US) CSS property associated with the transition. elapsedTimeArg
-
A
float
indicating the amount of time the animation has been running, in seconds, as of the time the event was fired, excluding any time the animation was paused. For an"animationstart"
event,elapsedTime
is0.0
unless there was a negative value foranimation-delay
(en-US), in which case the event will be fired withelapsedTime
containing(-1 * delay)
.
Specifications
Specification |
---|
CSS Animations Level 1 # dom-animationevent-animationevent |
Browser compatibility
BCD tables only load in the browser
See also
- Using CSS animations (en-US)
- Animation-related CSS properties and at-rules:
animation
(en-US),animation-delay
(en-US),animation-direction
(en-US),animation-duration
(en-US),animation-fill-mode
,animation-iteration-count
(en-US),animation-name
(en-US),animation-play-state
(en-US),animation-timing-function
(en-US),@keyframes
(en-US). - The
AnimationEvent
interface it belongs to.