web api instance method
AnimationEffect: updateTiming() method
The updateTiming() method of the AnimationEffect interface updates the specified timing properties for an animation effect.
Syntax
updateTiming(timing)
Parameters
timingOptional- : An object containing zero or more of the properties from the return value of
getTiming(), representing the timing properties to update.
- : An object containing zero or more of the properties from the return value of
Return value
None (undefined).
Exceptions
TypeError- : Thrown if invalid values are provided for any of the timing properties.
Examples
Side effects
updateTiming() may cause any associated Animation to start or stop playing, if for example the effect of a running animation is shortened such that its end time is before currentTime or the effect of a finished animation is lengthened such that its end time is after currentTime.
const animation = document.body.animate([], { duration: 1000 });
animation.finish();
console.log(animation.playState); // finished
animation.effect.updateTiming({ duration: 2000 });
console.log(animation.playState); // running
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.