Style transitionDuration Property
Example
Speed up the transition effect:
document.getElementById("myDIV").style.transitionDuration = "1s";
Try it Yourself »
Description
The transitionDuration property sets or returns how many seconds (s) or milliseconds (ms) a transition effect takes to complete.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
transitionDuration | 26.0 | 10.0 | 16.0 | 6.1 | 12.1 |
Syntax
Return the transitionDuration property:
object.style.transitionDuration
Set the transitionDuration property:
object.style.transitionDuration = "time|initial|inherit"
Property Values
Value | Description |
---|---|
time | Specifies how many seconds or milliseconds a transition effect takes to complete. Default value is 0, meaning there will be no effect |
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 transition-duration property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: transition-duration property
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.