这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
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. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
AnimationEvent
|
Chrome 43 | Edge 12 | Firefox 6 | IE 10 |
Opera
30
|
Safari
9.1
|
WebView Android 43 | Chrome Android 43 | Firefox Android 6 |
Opera Android
30
|
Safari iOS
9.3
|
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
|
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 |
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 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
使用非标名称。
要求使用供应商前缀或不同名称。
animation
,
animation-delay
,
animation-direction
,
animation-duration
,
animation-fill-mode
,
animation-iteration-count
,
animation-name
,
animation-play-state
,
animation-timing-function
,
@keyframes
.
AnimationEvent