This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
The KeyframeEffectReadOnly
interface of the Web Animations API describes sets of animatable properties and values that can be played using the Animation.Animation()
constructor, and which are inherited by KeyframeEffect
.
Note: The animations created with KeyframeEffectReadOnly
are immutable. To create animations you can change with JavaScript on the fly, try KeyframeEffect
instead.
KeyframeEffectReadOnly.KeyframeEffectReadOnly()
KeyframeEffectReadOnly
object instance, and also allows you to clone an existing keyframe effect object instance.This interface inherits some of its methods and properties from its parent AnimationEffectReadOnly
.
KeyframeEffectReadOnly.target
Read only
null
for animations that do not target a specific element.AnimationEffectReadOnly.timing
Read only
AnimationEffectTimingReadOnly
object associated with the animation containing all the animation's timing values.The following options are currently not shipped anywhere, but will be added in the near future.
KeyframeEffectReadOnly.composite
Read only
KeyframeEffectReadOnly.iterationComposite
Read only
KeyframeEffectReadOnly.spacing
Read only
KeyframeEffectReadOnly.getKeyframes()
Read only
AnimationEffectReadOnly.getComputedTiming()
Read only
In the Down the Rabbit Hole (with CSS Animations) example, all of Alice's animations are done with CSS. CSS Animations use KeyframeEffectReadOnly
objects, so you can't tinker with them directly with the Web Animations API. But you can inspect them like so:
// Have a look at the animations on Alice. // Her effect is a KeyframeEffectReadOnly object. document.getElementById("alice").getAnimations()[0].effect; // Inspect her timing object. document.getElementById("alice").getAnimations()[0].effect.timing; // See what her current timing values are right now. // How do they differ from the above? document.getElementById("alice").getAnimations()[0].effect.getComputedTiming();
Specification | Status | Comment |
---|---|---|
Web Animations The definition of 'keyframeEffectReadOnly' in that specification. | Working Draft | Editor's draft. |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | (Yes) | No support | (Yes) | No support | No support | No support |
composite , iterationComposite , and spacing options | No support | No support | No support | No support | No support | No support |
Clone constructor (2nd type of constructor) | (Yes) | No support | No support[1] | No support | No support | No support |
Feature | Android | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | No support | No support | No support |
composite , iterationComposite , and spacing options | No support | No support | No support | No support | No support | No support | No support |
Clone constructor (2nd type of constructor) | (Yes) | (Yes) | (Yes) | No support[1] | No support | No support | No support |
[1] Only enabled in Firefox 52 Nightly and Dev edition. Turned off in Beta/release.
AnimationEffectReadOnly
.KeyframeEffect
inherits from it.Animation
object.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffectReadOnly