TransitionEvent

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

TransitionEvent interface represents events providing information related to 过渡 .

构造函数

TransitionEvent()
创建 TransitionEvent event with the given parameters.

特性

Also inherits properties from its parent Event .

TransitionEvent.propertyName 只读
DOMString containing the name CSS property associated with the transition.
TransitionEvent.elapsedTime 只读
float giving the amount of time the transition has been running, in seconds, when this event fired. This value is not affected by the transition-delay 特性。
TransitionEvent.pseudoElement 只读
DOMString , starting with :: , containing the name of the pseudo-element the animation runs on. If the transition doesn't run on a pseudo-element but on the element, an empty string: '' .

Types of TransitionEvent

transitioncancel
An Event fired when a CSS transition has been cancelled.
transitionend
An Event fired when a CSS transition has finished playing.
transitionrun
An Event fired when a CSS transition is created, when it is added to a set of running transitions, though not nessarilty started
transitionstart
An Event fired when a CSS transition has started transitioning.

方法

Also inherits properties from its parent Event .

TransitionEvent.initTransitionEvent()
Initializes a TransitionEvent created using the deprecated Document.createEvent("TransitionEvent") 方法。

规范

规范 状态 Comment
CSS Transitions
The definition of 'TransitionEvent' in that specification.
工作草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
TransitionEvent
Chrome 27
27
不支持 2 — 71
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Edge 12 Firefox 4 IE 10 Opera Yes Safari Yes WebView Android Yes
Yes
不支持 ? — 71
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Chrome Android 27
27
不支持 18 — 71
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 2.0
2.0
不支持 1.0 — 10.0
Prefixed
Prefixed Implemented with the vendor prefix: WebKit
TransitionEvent() 构造函数
Chrome 27 Edge 79 Firefox 23 IE No Opera Yes Safari No WebView Android Yes Chrome Android 27 Firefox Android 23 Opera Android Yes Safari iOS No Samsung Internet Android 2.0
animationName
Chrome No Edge 12 — 79 Firefox 4 IE 10 Opera Yes Safari Yes WebView Android No Chrome Android No Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android No
elapsedTime
Chrome 2 Edge 12 Firefox 4 IE 10 Opera Yes Safari 6 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
initTransitionEvent
弃用 非标
Chrome No
不支持 No
Removal version unknown.
Edge 12 — 79 Firefox 6 — 23 IE 10 Opera No
不支持 No
Removal version unknown.
Safari Yes WebView Android No
不支持 No
Removal version unknown.
Chrome Android No
不支持 No
Removal version unknown.
Firefox Android 6 — 23 Opera Android No
不支持 No
Removal version unknown.
Safari iOS Yes Samsung Internet Android No
不支持 No
Removal version unknown.
propertyName
Chrome 2 Edge 12 Firefox Yes IE ? Opera Yes Safari 6 WebView Android Yes Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
pseudoElement
Chrome 2 Edge 79 Firefox 23 IE No Opera Yes Safari 6 WebView Android Yes Chrome Android 18 Firefox Android 23 Opera Android Yes Safari iOS No Samsung Internet Android 1.0

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
弃用。不要用于新网站。
见实现注意事项。
要求使用供应商前缀或不同名称。
要求使用供应商前缀或不同名称。

另请参阅