AnimationEffect.getComputedTiming()
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The getComputedTiming() method of the AnimationEffect interface returns the calculated timing properties for this animation effect.
Although many of the attributes of the returned object are common to the object returned by the AnimationEffect.getTiming() method, the values returned by this object differ in the following ways:
duration-
Returns the calculated value of the iteration duration. If
durationis the stringauto, this attribute will return0. fill-
The
autovalue is replaced with the appropriatefillvalue.
Note: 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
An 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 includesendDelayin 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
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
getComputedTiming |
75 |
79 |
63 |
No |
62 |
13.1 |
75 |
75 |
63 |
54 |
13.4 |
11.0 |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getComputedTiming