过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
AnimationEvent.initAnimationEvent()
method Initializes an animation event created using the deprecated
Document.createEvent("AnimationEvent")
方法。
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
.
animationEvent.initAnimationEvent(typeArg, canBubbleArg, cancelableArg, animationNameArg, elapsedTimeArg);
typeArg
DOMString
identifying the specific type of animation event that occurred. The following values are allowed:
| 值 | 含义 |
|---|---|
animationstart
|
The animation has started. |
animationend
|
The animation completed. |
animationiteration
|
The current iteration just completed. |
canBubbleArg
布尔
flag indicating if the event can bubble (
true
) 或不 (
false)
.
cancelableArg
布尔
flag indicating if the event associated action can be avoided (
true
) 或不 (
false)
.
animationNameArg
DOMString
containing the value of the
animation-name
CSS property associated with the transition.
elapsedTimeArg
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
is
0.0
unless there was a negative value for
animation-delay
, in which case the event will be fired with
elapsedTime
包含
(-1 *
delay
)
.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
initAnimationEvent
弃用
非标
|
Chrome
1 — 18
Alternate Name
|
Edge 12 — 16 | Firefox 6 — 23 | IE 10 | Opera 12.1 — 15 |
Safari
4 — 6
Alternate Name
|
WebView Android No | Chrome Android No | Firefox Android 6 — 23 | Opera Android 12.1 — 14 |
Safari iOS
3.2 — 6
Alternate Name
|
Samsung Internet Android No |
完整支持
不支持
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
使用非标名称。
animation
,
animation-delay
,
animation-direction
,
animation-duration
,
animation-fill-mode
,
animation-iteration-count
,
animation-name
,
animation-play-state
,
animation-timing-function
,
@keyframes
.
AnimationEvent
interface it belongs to.
AnimationEvent
initAnimationEvent()