HTML5笔记4
一、动画运动曲线的所有值和否应该轮流反向播放动画的所有值。
1、linear 动画从头到尾的速度是相同的。
2、ease 默认。动画以低速开始,然后加快,在结束前变慢。
3、ease-in 动画以低速开始。
4、ease-out 动画以低速结束。
5、ease-in-out 动画以低速开始和结束。
6、normal 默认值。动画按正常播放。
7、reverse 动画反向播放。
8、alternate 动画在奇数次(1、3、5…)正向播放,在偶数次(2、4、6…)反向播放。
9、alternate-reverse 动画在奇数次(1、3、5…)反向播放,在偶数次(2、4、6…)正向播放。
10、forwards 在动画结束后(由 animation-iteration-count 决定),动画将应用该属性值。
11、 backwards 动画将应用在 animation-delay 定义期间启动动画的第一次迭代的关键帧中定义的属性值。这些都是 from 关键帧中的值(当 animation-direction 为 “normal” 或 “alternate” 时)或 to 关键帧中的值(当 animation-direction 为 “reverse” 或 “alternate-reverse” 时)。
12、 both 动画遵循 forwards 和 backwards 的规则。也就是说,动画会在两个方向上扩展动画属性。
13、 paused 指定暂停动画 测试 »
14、 running 指定正在运行的动画
示例:
<style type="text/css">
.box{
width: 200px;
height: 200px;
background-color: red;
animation: move 3s linear 0s 1 normal forwards;
transition: all 5s linear 2s;
}
</style>
</head>
<body>
<div class="box"></div>