Style animationDuration Property
Examples
Change the animationDuration property of the <div> element:
document.getElementById("myDIV").style.animationDuration="3s";
Try it yourself »
Definition and Usage
The animationDuration property defines the number of seconds an animation takes to complete one cycle.
Browser Support
![]()
![]()
![]()
![]()
![]()
Only Firefox supports the animationDuration property.
Syntax
Return the animationDuration property:
object.style.animationDuration
Set the animationDuration property:
object.style.animationDuration="time|initial|inherit"
Property Values
| Value | Description |
|---|---|
| time | Specifies the duration of the animation. The default value is 0, meaning there is no animation. |
| initial | Sets this property to its default value. Seeinitial。 |
| inherit | Inherits this property from its parent element. Seeinherit。 |
Technical Details
| Default Value: | 0 |
|---|---|
| Return Value: | A string representing the animation-duration property of an element. |
| CSS Version | CSS3 |
Related Articles
CSS Reference:animation-duration property
Other Extensions
Style Object