此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

AnimationEffect

基线 广泛可用

自 2020年3月 起,此特性已在主流浏览器中得到支持,可在大多数设备和浏览器版本中正常使用。

Web 动画 APIAnimationEffect 接口表示动画的效果。

AnimationEffect 是一个抽象接口,因此不能直接实例化。但像 KeyframeEffect 这样的具体接口继承自它,你可以将这些接口的实例传递给 Animation 对象进行播放,或在 CSS 动画过渡中使用它们。

实例方法

AnimationEffect.getTiming()

返回与动画相关联的包含所有动画的计时的对象。

AnimationEffect.getComputedTiming()

返回此 AnimationEffect 的计算计时属性。

AnimationEffect.updateTiming()

更新此 AnimationEffect 的指定计时属性。

规范

规范
Web Animations
# the-animationeffect-interface

浏览器兼容性

参见