Animation.effect

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

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

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
effect

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见