animation-direction
animation-direction
This page has been flagged with the following issues:
High-level issues:
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-inanimation is replaced with anease-outanimation 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
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
- CSS Animations W3C Working Draft, Section 3.3
- CSS Animations Module Level 3, Section 3.6
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)
CSSStyleDeclarationcurrentStylestyleaabbracronymbbdobigbrcitecodedfnemiimginputkbdlabelqsampselectsmallspanstrongsubsuptextAreattvaraddressblockQuotedivdlfieldSetformnoFramesnoScriptolppretableuldddtlitBodytdtFootthtHeadtrbuttondelinsmapobjectscript
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here