Style animationDuration attribute

Definition and usage

animationDuration Attribute defines the number of seconds or milliseconds required for the animation to complete one cycle.

Example

Change the animationDuration attribute of the <div> element:

document.getElementById("myDIV").style.animationDuration = "3s";

Try it yourself

Syntax

Returns the animationDuration attribute:

object.style.animationDuration

Sets the animationDuration attribute:

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

Attribute value

Value Description
time Specifies the length required for the animation to complete. The default value is 0, indicating no animation.
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: String, indicating the element's animation-duration egenskab.
CSS version: CSS3

Browser support

animationDuration Is a CSS3 (1999) feature.

All browsers fully support it:

Chrome Edge Firefox Safari Opera IE
Chrome Edge Firefox Safari Opera IE
Supporter Supporter Supporter Supporter Supporter 11

Relaterede sider

CSS reference manual:animation-duration egenskab