animation-direction

Jump to: navigation, search

animation-direction


W3C Working Draft

Summary

Defines an animation's direction, including whether an animation runs in reverse in some or all cycles.

Overview table

Initial value normal
Applies to all elements
Inherited No
Media visual
Computed value as specified
Animatable No
CSS Object Model Property

Syntax

  • animation-direction: normal
  • animation-direction: alternate
  • animation-direction: reverse
  • animation-direction: alternate-reverse


Values

normal
The animation should play forward each cycle. In other words, each time the animation cycles, the animation will reset to the beginning state and start over again. This is the default animation direction setting.
alternate
The animation should reverse direction each cycle. When playing in reverse, the animation steps are performed backward. In addition, timing functions are also reversed; for example, an ease-in animation is replaced with an ease-out animation when played in reverse. The count to determine if it is an even or an odd iteration starts at one.
reverse
The animation plays backward each cycle. Each time the animation cycles, the animation resets to the end state and start over again.
alternate-reverse
The animation plays backward on the first play-through, then forward on the next, then continues to alternate. The count to determine if it is an even or an odd iteration starts at one.


Examples

View live example

CSS

animation-direction: alternate;

Usage

The animation-direction property takes as its value a keyword indicating the direction of a single animation cycle. If multiple keywords are separated by commas, they are applied to each animation in the same order as specified in animation-name. The number of values specified for animation-direction doesn't need to match. If there are more values than for animation-name, the excess values are ignored. If there are fewer, the browser cycles through them again until each animation has been assigned a direction


Syntax

'animation-direction: '[ normal | alternate | reverse | alternate-reverse ] [ , [ normal | alternate | reverse | alternate-reverse ] ] *

Standards information

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support
4.0 -webkit
16.0
5.0 -moz
10.0
12.1
12.0 -o
4.0 -webkit

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support
2.1 -webkit
7.0 -webkit
18.0 -webkit
16.0
15.0 -moz
WP 8 (IE 10)
12.1
Unsupported
3.2 -webkit


Compatibility notes

Browser Version Note
Firefox < 15.0 Supports only normal and alternate
Opera 12.0 Supports only normal and alternate
Safari < 6.0 Supports only normal and alternate
Internet Explorer 10.0 The -ms- prefixed property is deprecated and should not be used.

See also

Related articles

Animation



















  • animation-direction















Related pages (MSDN)

  • CSSStyleDeclaration
  • currentStyle
  • style
  • a
  • abbr
  • acronym
  • b
  • bdo
  • big
  • br
  • cite
  • code
  • dfn
  • em
  • i
  • img
  • input
  • kbd
  • label
  • q
  • samp
  • select
  • small
  • span
  • strong
  • sub
  • sup
  • textArea
  • tt
  • var
  • address
  • blockQuote
  • div
  • dl
  • fieldSet
  • form
  • noFrames
  • noScript
  • ol
  • p
  • pre
  • table
  • ul
  • dd
  • dt
  • li
  • tBody
  • td
  • tFoot
  • th
  • tHead
  • tr
  • button
  • del
  • ins
  • map
  • object
  • script

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]