Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style transitionProperty property

Style transitionProperty property

Style Object Reference The Style object

Example

When you hover the mouse pointer over a div element, its width and height will gradually change:

document.getElementById("myDIV").style.transitionProperty="width,height";

Try it »


Definition and Usage

The transitionProperty property specifies the name of the CSS property to which the transition effect applies. (The transition effect will start when the specified CSS property changes.)

**Tip:** Transition effects usually occur when the user hovers the mouse pointer over an element.

**Note:** Always set the transitionDuration property, otherwise the duration will be 0 and no transition effect will occur.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 10, Firefox, Opera and Chrome support the transitionProperty property.

Safari supports another property that can replace this property, namely the WebkitTransitionProperty property.

**Note:** Internet Explorer 9 and earlier versions do not support the transitionProperty property.


Syntax

Return the transitionProperty property:

object

.style.transitionProperty

Set the transitionProperty property:

object

.style.transitionProperty="none|all|

property

|initial|inherit"

Attribute values

Value Description
none No property will receive a transition effect.
all Default. All properties will receive a transition effect.
property Defines a comma-separated list of CSS property names to which the transition effect applies.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: all
Return Value: A string, representing the transition-property property of an element.
CSS version CSS3

Related Articles

CSS Reference Manual:transition-property property


Style Object Reference The Style object