这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

AnimationEvent interface represents events providing information related to animations .

  <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/Event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text  x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25  86,20  86,30  76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/AnimationEvent" target="_top"><rect x="116" y="1" width="140" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text  x="186" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">AnimationEvent</text></a></svg></div>
					
  a:hover text { fill: #0095DD; pointer-events: all;}
					

构造函数

AnimationEvent()
创建 AnimationEvent 事件采用给定参数。

特性

还继承特性从其父级 事件 .

AnimationEvent.animationName 只读
DOMString containing the value of the animation-name that generated the animation.
AnimationEvent.elapsedTime 只读
float giving the amount of time the animation has been running, in seconds, when this event 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 ) .
AnimationEvent.pseudoElement 只读
DOMString , starting with '::' , containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: '' .

方法

Also inherits methods from its parent 事件 .

AnimationEvent.initAnimationEvent()
初始化 AnimationEvent created using the deprecated Document.createEvent("AnimationEvent") 方法。

规范

规范 状态 注释
CSS 动画
The definition of 'AnimationEvent' in that specification.
工作草案 初始定义。

浏览器兼容性

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
AnimationEvent Chrome 43 Edge 12 Firefox 6 IE 10 Opera 30
30
不支持 15 — 57 Prefixed
Prefixed Implemented with the vendor prefix: WebKit
不支持 12.1 — 15
12 Prefixed
Prefixed Implemented with the vendor prefix: o
Safari 9.1
9.1
4 Prefixed
Prefixed Implemented with the vendor prefix: WebKit
WebView Android 43 Chrome Android 43 Firefox Android 6 Opera Android 30
30
不支持 14 — 49 Prefixed
Prefixed Implemented with the vendor prefix: WebKit
不支持 12.1 — 14
12 Prefixed
Prefixed Implemented with the vendor prefix: o
Safari iOS 9.3
9.3
3.2 Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Samsung Internet Android 4.0
AnimationEvent() 构造函数 Chrome 43 Edge ≤79 Firefox 23 IE No Opera No Safari No WebView Android 43 Chrome Android 43 Firefox Android 23 Opera Android No Safari iOS ? Samsung Internet Android 4.0
animationName Chrome 43 Edge 12 Firefox 6 IE 10 Opera 30 Safari 9 WebView Android 43 Chrome Android 43 Firefox Android 6 Opera Android 30 Safari iOS 9 Samsung Internet Android 4.0
elapsedTime Chrome 43 Edge 12 Firefox 6 IE 10 Opera 30 Safari 9 WebView Android 43 Chrome Android 43 Firefox Android 6 Opera Android 30 Safari iOS 9 Samsung Internet Android 4.0
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
pseudoElement Chrome 68 Edge 79 Firefox 23 IE No Opera No Safari No WebView Android 68 Chrome Android 68 Firefox Android 23 Opera Android No Safari iOS No Samsung Internet Android 10.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

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

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

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

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

弃用。不要用于新网站。

弃用。不要用于新网站。

使用非标名称。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

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

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

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