Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Animation.finished

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

Animation.finished只读属性允许您返回动画的完成状态。

Note: The Promise is replaced with a new (pending) Promise object every time the animation leaves the finished play state.

语法

var animationsPromise = animation.finished;

一个Promise对象。

例子

以下代码会等到所有动画都完成,然后再移除它们处于活动状态的元素:

Promise.all(
  elem.getAnimations().map( 
    function(animation) { 
      return animation.finished 
    }
  )
).then(
  function() {
    return elem.remove();
  }
);

规范

Specification Status Comment
Web Animations
Animation.finished
Working Draft Editor's draft.

浏览器支持

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 未实现 未实现 未实现 未实现 未实现
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 未实现 未实现 未实现 未实现 未实现

 

相关内容

文档标签和贡献者

 此页面的贡献者: Taoja
 最后编辑者: Taoja,