Animation.effect
Baseline 2022
Newly available
Since September 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Animation.effect 属性可以获取或设置动画的目标效果。目标效果可以是KeyframeEffect
对象或 null。
语法
js
// Get an Animation object's target effect
var effect = animation.effect;
// Set an Animation's target effect
animation.effect = new KeyframeEffect({ opacity: [1, 0] }, 300);
值
KeyframeEffect
对象或 null。
规范
Specification |
---|
Web Animations # dom-animation-effect |
浏览器兼容性
BCD tables only load in the browser