Style animationDelay Property
Example
Changing the animationDelay property of a <div> element:
document.getElementById("myDIV").style.animationDelay = "1s";
Try it Yourself »
Definition and Usage
The animationDelay property defines when the animation will start.
The animationDelay value is defined in seconds (s) or milliseconds (ms).
Tip: Negative values are allowed, -2s makes the animation start at once, but starts 2 seconds into the animation.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
animationDelay | 43.0 | 79.0 | 16.0 | 9.0 | 30.0 |
Syntax
Return the animationDelay property:
object.style.animationDelay
Set the animationDelay property:
object.style.animationDelay = "time|initial|inherit"
Property Values
Value | Description |
---|---|
time | Optional. Defines the number of seconds or milliseconds to wait before the animation will start. Default value is 0 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technical Details
Default Value: | 0 |
---|---|
Return Value: | A String, representing the animation-delay property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: animation-delay property