--- title: Animation.effect slug: Web/API/Animation/effect translation_of: Web/API/Animation/effect ---
{{ SeeCompatTable() }} {{ APIRef("Web Animations API") }}
Animation.effect属性可以获取或设置动画的目标效果。 目标效果可以是{{domxref("KeyframeEffect")}}对象或null。
// 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);
{{domxref("KeyframeEffect")}}对象或null.
Specification | Status | Comment |
---|---|---|
{{SpecName('Web Animations', '#dom-animation-effect', 'Animation.effect' )}} | {{Spec2('Web Animations')}} | Editor's draft. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |