CSS animation-direction Property

Description

The animation-direction property defines whether or not the animation should play in reverse on some or all cycles. When an animation is played in reverse the timing functions are also reversed. For example, when played in reverse an ease-in animation would appear to be an ease-out animation.

Initial value
normal
Applies to
All elements, :before and :after pseudo elements
Inherited
No
Media
Visual
Computed value
As specified
Animatable
No
CSS Version
CSS3
JavaScript syntax
object.style.animationDirection

Syntax

Formal syntax: <single-animation-direction> [ ',' <single-animation-direction> ]*

animation-direction: normal; 
animation-direction: reverse; 
animation-direction: alternate; 
animation-direction: alternate-reverse; 

Values

<single-animation-direction> = normal | reverse | alternate | alternate-reverse
  • normalAll iterations of the animation are played as specified.
  • reverseAll iterations of the animation are played in the reverse direction from the way they were specified.
  • alternateThe animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction.
  • alternate-reverseThe animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction.

Example

.class {
   animation-direction: alternate;
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
10?????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????