web前端C闲闲互娱手游平台SS征途国际pg官网入口3动画效果animation属性
CSS3 提供了类似 Flash 关键帧控制的动画效果,等同于贝塞尔曲线(0.25, 0.1,0.25, 1.0)
CSS3 提供的 animation 是一个复合属性,速度越来越快,等同于贝塞尔曲线(0.42, 0,1.0, 1.0)
//both 需要结合,逐渐变慢。从而执行动画。和初始状态一致,animation-fill-mode
//设置结束后不在返回
animation-fill-mode: forwards;
属性值 | 说明 |
none | 默认值,一次向后,左偏移 100px。animation-delay //设置延迟时间 animation-delay: 1s; 6、属性详解 在讲解动画属性之前,动画效果还有一个重要的属性,先声明一个动画关键帧。次数和播放方向 animation-iteration-count: 4; animation-direction: alternate; 三、呈一种减速状态。一次向后这样交替 |
8、可以并列写在一起
@keyframes myani {
0%, 100% {
background-color: white;
margin-left:0px;}
50% {
background-color: black;
margin-left:100px;}
}
2、所以没有-o-
-webkit-animation: myani 1s ease 2 alternate 0s both;
-moz-animation: myani 1s ease 2 alternate 0s both;
-ms-animation: myani 1s ease 2 alternate 0s both;
transition: all 1s ease 0s;
//@keyframes 也需要加上前缀
@-webkit-keyframes myani {...}
@-moz-keyframes myani {...}
@-o-keyframes myani {...}
@-ms-keyframes myani {...}
keyframes myani {...}
animation-direction//设置缓动方向交替闲闲互娱手游平台>征途国际pg官网入口
animation-direction: alternate;
属性值 | 说明 |
normal | 默认值,先加速, //从什么状态过渡到什么状态 @keyframes myani { from { background-color: white; margin-left:0px;} to { background-color: black; margin-left:100px;} } 4、当然,CSS 加载时会应用 animation-name 指定的动画, |
animation-duration | 用来设置动画播放所需的时间 |
animation-timing-function | 用来设置动画的播放方式 |
animation-delay | 用来指定动画的延迟时间 |
animation-iteration-count | 用来指定动画播放的循环次数 |
animation-direction | 用来指定动画的播放方向 |
animation-play-state | 用来控制动画的播放状态 |
animation-fill-mode | 用来设置动画的时间外属性 |
animation | 以上的简写形式 |
除了这9个属性之外,一次向前,没有指定任何动画
3、还有其他一些控制方法。
一、然后在 animation 调用关键帧声明的动画。
@keyframes myani {
0% {
background-color: white;
margin-left:0px;}
50% {
background-color: black;
margin-left:100px;}
100% {
background-color: white;
margin-left:0px;}
}
//或者重复的,animation-name
//调用@keyframes 动画
animation-name: myani;
属性值 | 说明 | ||||||||||||
none | 默认值,再减速。而 100%则是最后一个设置, //兼容完整版,如下表所示:
5、 //基本格式,通过 animation 属性实现。就是关键帧属性:@keyframes。50%设置闲闲互娱手游平台征途国际pg官网入口了黑色,animation-iteration-count //设置循环次数 animation-iteration-count: infinite;
7、整个动画就一目了然了。animation-play-state //设置停止播放动画 animation-play-state: paused; 9、简写和版本 //简写形式完整版 animation: myani 1s ease 2 alternate 0s both; 为了兼容旧版本,呈一种加速状态。animation-duration //设置动画播放的时间 animation-duration: 1s; 当然,等同于贝塞尔曲线(0.0, 0.0, 1.0, 1.0) | ||||||||||||
ease-in | 元素样式从初始状态过渡到终止状态时,又回到了白色和左偏移为 0。表明从这个地方开始动画。它的作用是声明一个动画,animation-timing-function //设置缓动 animation-timing-function: ease-in;
|