AnimationEffectTimingReadOnly.delay

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 delay property of the AnimationEffectTimingReadOnly object represents the number of milliseconds to delay the start of the animation.

Note: In AnimationEffectTiming, a mutable subclass of AnimationEffectTimingReadOnly used withKeyframeEffects, the property acts as both a getter and a setter.

Syntax

JavaScript
// Getting the delay in milliseconds
var animationDelay = animation.effect.timing.delay;

// Setting the delay in milliseconds 
animation.effect.timing.delay = 200;

Value

A number representing milliseconds. Defaults to 0.

Examples

In the Growing and Shrinking Alice example, we set a delay of 2000 milliseconds (2 seconds) on an animation that shows a "game over" tile. At the end of the game, for two seconds a vignette is shown before the "game over" interface appears. Below you can see that even though we call play() immediately after setting the delay, the animation will wait two second before begining:

JavaScript
bringUI.effect.timing.delay = 2000;
bringUI.play();

Specifications

Specification Status Comment
Web Animations
The definition of 'AnimationEffectTimingReadOnly.delay' in that specification.
Working Draft Editor's draft.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) 48 (48) 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 ? ? ? ? ? No support No support No support

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/animationeffecttimingreadonly/delay

Animation AnimationEffectTimingReadOnly API delay Experimental Property Reference waapi web animations api