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

HTML DOM Style animationDirection Property

Style animationDirection Property

Style Object Reference The Style object

Example

changing

The animationDirection property of an element:

document.getElementById("myDIV").style.animationDirection="reverse";

Try it »


Definition and Usage

The animationDirection property sets or returns whether the animation should be played in reverse on alternate cycles.

**Note:** If the animation is set to play only once, this property has no effect.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Firefox supports the animationDirection property.


Syntax

Return the animationDirection property:

object

.style.animationDirection

Set the animationDirection property:

object

.style.animationDirection="normal|reverse|alternate|alternate-reverse|initial|inherit"

Attribute values

Value Description
normal Default. The animation is played normally.
reverse The animation is played in reverse.
alternate The animation is played forward on odd cycles (1, 3, 5...) and in reverse on even cycles (2, 4, 6...).
alternate-reverse The animation is played in reverse on odd cycles (1, 3, 5...) and forward on even cycles (2, 4, 6...).
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: normal
Return Value: A string representing the animation-direction property of the element.
CSS version CSS3

Related Articles

CSS Reference Manual:animation-direction Property


Style Object Reference The Style object