--- title: animation-direction slug: Web/CSS/animation-direction tags: - CSS - CSS Animations - CSS Property - Experimental - Reference translation_of: Web/CSS/animation-direction ---
animation-direction
CSS 属性指示动画是否反向播放,它通常在简写属性{{cssxref("animation")}}中设定
{{cssinfo}}
Formal syntax: {{csssyntax("animation-direction")}}
animation-direction: normal animation-direction: reverse animation-direction: alternate animation-direction: alternate-reverse animation-direction: normal, reverse animation-direction: alternate, reverse, normal
normal
每个循环内动画向前循环,换言之,每个动画循环结束,动画重置到起点重新开始,这是默认属性。
alternate
动画交替反向运行,反向运行时,动画按步后退,同时,
带时间功能的函数也反向,比如,ease-in 在反向时成为ease-out。计数取决于开始时是奇数迭代还是偶数迭代reverse
alternate-reverse
反向交替, 反向开始交替
See CSS animations for examples.
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS3 Animations', '#animation-direction', 'animation-direction')}} | {{Spec2('CSS3 Animations')}} | For the two new values, see the W3C discussion. |
{{Compat("css.properties.animation-direction")}}