在逆战班学习的第4周
animation的属性值:
1、animation-name
检索或设置对象所应用的动画名称
必须与规则@keyframes配合使用,
eg:@keyframes mymove{} animation-name:mymove;
2、animation-duration
检索或设置对象动画的持续时间
说明:animation-duration:3s; 动画完成使用的时间为3s
3、animation-timing-function
检索或设置对象动画的过渡类型
属性值
linear:线性过渡。等同于贝塞尔曲线(0.0, 0.0, 1.0, 1.0)
ease:平滑过渡。等同于贝塞尔曲线(0.25, 0.1, 0.25, 1.0)
ease-in:由慢到快。等同于贝塞尔曲线(0.42, 0, 1.0, 1.0)
ease-out:由快到慢。等同于贝塞尔曲线(0, 0, 0.58, 1.0)
ease-in-out:由慢到快再到慢。等同于贝塞尔曲线(0.42, 0, 0.58, 1.0)
- step-start:马上跳到动画每一结束桢的状态
4、animation-delay
检索或设置对象动画延迟的时间
说明:animation-delay:0.5s; 动画开始前延迟的时间为0.5s)
5、animation-iteration-count
检索或设置对象动画的循环次数
属性值
animation-iteration-count: infinite | number;
infinite:无限循环
number: 循环的次数
6、animation-direction
检索或设置对象动画在循环中是否反向运动
属性值
normal:正常方向
reverse:反方向运行
alternate:动画先正常运行再反方向运行,并持续交替运行
alternate-reverse:动画先反运行再正方向运行,并持续交替运行
7、animation-play-state
检索或设置对象动画的状态
属性值
animation-play-state:running | paused;
running:运动
paused: 暂停
animation-play-state:paused; 当鼠标经过时动画停止,鼠标移开动画继续执行