过时
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
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 is 0.0 unless there was a negative value for animation-delay , in which case the event will be fired with elapsedTime 包含 (-1 * delay ) .

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
initAnimationEvent 弃用 非标 Chrome 1 — 18 Alternate Name
不支持 1 — 18 Alternate Name
Alternate Name Uses the non-standard name: initWebKitAnimationEvent
Edge 12 — 16 Firefox 6 — 23 IE 10 Opera 12.1 — 15 Safari 4 — 6 Alternate Name
不支持 4 — 6 Alternate Name
Alternate Name Uses the non-standard name: initWebKitAnimationEvent
WebView Android No Chrome Android No Firefox Android 6 — 23 Opera Android 12.1 — 14 Safari iOS 3.2 — 6 Alternate Name
不支持 3.2 — 6 Alternate Name
Alternate Name Uses the non-standard name: initWebKitAnimationEvent
Samsung Internet Android No

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

使用非标名称。

另请参阅

元数据

  • 最后修改:
  1. AnimationEvent
  2. 构造函数
    1. AnimationEvent()
  3. 特性
    1. animationName
    2. elapsedTime
    3. pseudoElement
  4. 方法
    1. initAnimationEvent()
  5. 继承:
    1. 事件

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1