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 can be used,-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 that represents the element's animation-delay egenskap.
CSS version: CSS3

Browser support

animationDelay is a CSS3 (1999) feature.

All web browsers fully support it:

Chrome Edge Firefox Safari Opera IE
Chrome Edge Firefox Safari Opera IE
Stöd Stöd Stöd Stöd Stöd 11

Relaterade sidor

CSS referenshandbok:animation-delay egenskap