Style transitionDuration attribute

Definition and Usage

transitionDuration Property sets or returns how many seconds (s) or milliseconds (ms) are needed to complete the transition effect.

See Also:

CSS Reference Manual:transition-duration attribute

Example

Accelerate Transition Effect:

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

Try It Yourself

Syntax

Return transitionDuration attribute:

object.style.transitionDuration

Set transitionDuration attribute:

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

Property Value

Value Description
time Specifies the number of seconds or milliseconds needed to complete the transition effect. The default value is 0, indicating no effect.
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 transition-duration attribute.
CSS Version: CSS3

Browser Support

The numbers in the table indicate the browser version that first fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
26.0 10.0 16.0 6.1 12.1