animation
CSS animation 属性是 animation-name,animation-duration, animation-timing-function,animation-delay,animation-iteration-count,animation-direction,animation-fill-mode 和 animation-play-state 属性的一个简写属性形式。
uni-app x 兼容性 ?
| Android(VDOM) | Android(Vapor) | iOS(VDOM) | iOS(Vapor) | HarmonyOS(VDOM) | HarmonyOS(Vapor) |
| x | 5.25 | x | 5.25 | x | 5.25 |
App平台拍平(flatten)兼容性 ?
| Android(Vapor) | iOS(Vapor) | HarmonyOS(Vapor) |
| x | x | x |
语法
示例源码如下,请查看 pre > code 标签中的内容
animation: <single-animation>#;
animation 的属性值
| 名称 | 兼容性 | 描述 |
| alternate | | The 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-reverse | | The 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. |
| backwards | | The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'. |
| both | | Both forwards and backwards fill modes are applied. |
| forwards | | The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes. |
| infinite | | Causes the animation to repeat forever. |
| none | | No animation is performed |
| normal | | Normal playback. |
| reverse | | All iterations of the animation are played in the reverse direction from the way they were specified. |
参见