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 getComputedTiming() method of the AnimationEffectReadOnly interface returns the calculated timing properties for this animation effect.
Although many of the attributes of the returned object are common to the AnimationEffectTimingReadOnly contained in the object returned by the AnimationEffectReadOnly.timing attribute, the values returned by this object differ in the following ways:
duration- Returns the calculated value of the iteration duration. If
AnimationEffectTimingReadOnly.durationis the stringauto, this attribute will return0. fill- The
autovalue is replaced with the appropriateAnimationEffectTimingReadOnly.fillvalue.
These values are comparable to the computed styles of an Element returned using window.getComputedStyle(elem).
Syntax
var currentTimeValues = animation.getComputedTiming();
Parameters
None.
Return Value
A ComputedTimingProperties dictionary object, which contains the following properties:
- endTime
- The end time of the animation in milliseconds from the animation's start (if the
KeyframeEffectis associated with anAnimation). (Also includesAnimationEffectTimingReadOnly.endDelayin that calculation.) - activeDuration
- The length of time in milliseconds that the animation's effects will run. This is equal to the iteration duration multiplied by the iteration count.
- localTime
- The current time of the animation in milliseconds. If the
KeyframeEffectis not associated with anAnimation, its value isnull. - progress
- Indicates how far along the animation is through its current iteration with values between
0and1. Returnsnullif the animation is not running or itsKeyframeEffectisn't associated with anAnimation. - currentIteration
- The number of times this animation has looped, starting from
0. Returnsnullif the animation is not running or itsKeyframeEffectisn't associated with anAnimation.
Specifications
| Specification | Status | Comment |
|---|---|---|
| Web Animations The definition of 'AnimationEffectReadOnly.getComputedTiming()' in that specification. |
Working Draft | Editor's draft. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | No support | No support | No support | No support | No support |
| Feature | Android | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic support | No support | No support | No support | No support | No support | No support | No support | No support |