Style animationDelay attribute

Definition and usage

animationDelay Attribute defines when the animation starts.

animationDelay Values are defined in seconds (s) or milliseconds (ms).

Tip:Negative values are allowed,-2s Start the animation immediately, but play it at the 2-second mark.

Example

Change the animationDelay property of the <div> element:

document.getElementById("myDIV").style.animationDelay = "1s";

Try it yourself

Syntax

Return the animationDelay property:

object.style.animationDelay

Set the animationDelay property:

object.style.animationDelay = "time|initial|inherit"

Attribute value

Value Description
time Optional. Defines the number of seconds or milliseconds to wait before the animation starts. The default value is 0.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical details

Default value: 0
Return value: A string representing the element's animation-delay attribute.
CSS version: CSS3

Browser support

animationDelay is a CSS3 (1999) feature.

All browsers fully support it:

Chrome Edge Firefox Safari Opera IE
Chrome Edge Firefox Safari Opera IE
Support Support Support Support Support 11

Related pages

CSS reference manual:animation-delay attribute