Hover over a div element to gradually change its width and height:
document.getElementById("myDIV").style.transitionProperty = "width,height";
Try it Yourself »
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.
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 | 12.1 |
Return the transitionProperty property:
object.style.transitionProperty
Set the transitionProperty property:
object.style.transitionProperty = "none|all|
property|initial|inherit"
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 |
Default Value: | all |
---|---|
Return Value: | A String, representing the transition-property property of an element |
CSS Version | CSS3 |
CSS reference: transition-property property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!