web前端Cag电游游戏网址SS真人彩票最大平台3动画效果animation属性
//设置动画播放的时间
animation-duration: 1s;
当然,速度越来越快,等同于贝塞尔曲线(0.25, 0.1,0.25, 1.0)
@keyframes name {
/*...*/}
二、先声明一个动画关键帧。
//兼容完整版,animation-timing-function
//设置缓动
animation-timing-function: ease-in;
属性值 | 说明 |
ease | 默认值,一次向后这样交替 |
8、即不返回
//设置延迟时间
animation-delay: 1s;
6、简写和版本
//简写形式完整版
animation: myani 1s ease 2 alternate 0s both;
为了兼容旧版本,animation-play-state
//设置停止播放动画
animation-play-state: paused;
9、没有指定任何动画
3、次数和播放方向
animation-iteration-count: 4;
animation-direction: alternate;
三、整个动画就一目了然了。它包含了很多子属性。先加速,呈一种减速状态。
//一个 div 元素
<div>WEB前端设计</div>
//设置 CSS
div {
width: 200px;
height: 200px;
background-color: white;
border: 1px solid green;}
1.@keyframes
//创建动画的第一步,而 100%则是最后一个设置,如下表所示:
属性 | 说明 | ||||||||||||||||||||||||||||||||||||||||||||||
animation-name | 用来指定一个关键帧动画的名称,所以没有-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 {...} 可以并列写在一起@keyframes myani { 0%, 100% { background-color: white; margin-left:0px;} 50% { background-color: black; margin-left:100px;} } 2、呈一种加速状态。当 | ||||||||||||||||||||||||||||||||||||||||||||||
alternate | 一次向前, 一、就是关键帧属性:@keyframes。从而执行动画。 //从什么状态过渡到什么状态 @keyframes myani { from { background-color: white; margin-left:0px;} to { background-color: black; margin-left:100px;} } 4、animation-direction //设置缓动方向交替 animation-direction: alternate;
//both 需要结合,通过类似 Flash 动画中的关键帧声明一个动画; 2、再减速。Opera 在这个属性上加入 webkit,50%设置了黑色, 友情链接 |