Style transitionProperty Property
Example
Hover over a div element to gradually change its width and height:
document.getElementById("myDIV").style.transitionProperty = "width,height";
Try it Yourself »
Definition and Usage
The transitionProperty property specifies the name of the CSS property the transition effect is for (the transition effect will start when the specified CSS property changes).
Tip: A transition effect could typically occur when a user hover over an element.
Note: Always specify the transitionDuration property, otherwise the duration is 0, and the transition will have no effect.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
transitionProperty | 26.0 | 10.0 | 16.0 | 6.1 3.1 WebkitTransitionProperty |
12.1 |
Syntax
Return the transitionProperty property:
object.style.transitionProperty
Set the transitionProperty property:
object.style.transitionProperty = "none|all|property|initial|inherit"
Property Values
Value | Description |
---|---|
none | No property will get a transition effect |
all | Default value. All properties will get a transition effect |
property | Defines a comma separated list of CSS property names the transition effect is for |
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: | all |
---|---|
Return Value: | A String, representing the transition-property property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: transition-property property
❮ Style Object