This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The AnimationEffectTiming
interface of the Web Animations API is comprised of timing properties. It is returned by the timing
attribute of a KeyframeEffect
.
This interface inherits its properties from AnimationEffectTimingReadOnly
, but in a non-read only form.
This interface inherits its properties from its parent, AnimationEffectTimingReadOnly
, in a non-read only form.
AnimationEffectTimingReadOnly.delay
0
.AnimationEffectTimingReadOnly.endDelay
0
.AnimationEffectTimingReadOnly.fill
backwards
), retained after the animation has completed playing (forwards
), or both
. Defaults to none
.AnimationEffectTimingReadOnly.iterationStart
AnimationEffectTimingReadOnly.iterations
1
, and can also take a value of infinity to make it repeat infinitely.AnimationEffectTimingReadOnly.duration
0
.AnimationEffectReadOnly.direction
normal
), backwards (reverse
), switches direction after each iteration (alternate
), or runs backwards and switches direction after each iteration (alternate-reverse
). Defaults to normal
.AnimationEffectTimingReadOnly.easing
linear
, ease
, ease-in
, ease-out
, and ease-in-out
, or a custom cubic-bezier value like cubic-bezier(0.42, 0, 0.58, 1)
. Defaults to linear
.In the Growing and Shrinking Alice example, we set Alice's animation — aliceChange
— at halfway complete by getting the duration of its effect
's timing
attribute, which returns an AnimationEffectTiming
object:
aliceChange.currentTime = aliceChange.effect.timing.duration / 2 ;
Specification | Status | Comment |
---|---|---|
Web Animations The definition of 'AnimationEffectTiming' in that specification. | Working Draft | Editor's draft. |
Feature | Chrome | Firefox (Gecko) | Microsoft Edge | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | No support | 48 (48)[1] | ? | No support | (Yes) | No support |
Feature | Android | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|
Basic support | ? | ? | ? | 48.0 (48)[1] | ? | No support | No support | No support |
[1] The Web Animations API is only enabled by default in Firefox Developer Edition and Nightly builds. You can enable it in beta and release builds by setting the preference dom.animations-api.core.enabled
to true
, and can disable it in any Firefox version by setting this preference to false
.
KeyframeEffect
AnimationEffectTimingReadOnly
© 2005–2018 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/AnimationEffectTiming