当前位置: 首页 » 教程 » css动画animation正文

css动画animation

  • 零分
  • 698

使用简写属性,将动画与 div 元素绑定:

div
{
animation:mymove 5s infinite;
-webkit-animation:mymove 5s infinite; /* Safari 和 Chrome */
}
@keyframes mymove
{
from {left:0px;}
to {left:200px;}
}

简单例子, 1、一直循环旋转

@keyframes xz {
from {transform:rotate(0deg);}
to {transform:rotate(360deg);}
}
.div{
width:128px;
height:128px;
animation:xz 2s linear 0s infinite normal;
}

2、鼠标经过一直旋转

.div2,.div4{
width:128px;
height:128px;
}

animation属性;

animation: name duration timing-function delay iteration-count direction;

animation-name 规定需要绑定到选择器的 keyframe 名称。。
animation-duration 规定完成动画所花费的时间,以秒或毫秒计。
animation-timing-function 规定动画的速度曲线。
animation-delay 规定在动画开始之前的延迟。
animation-iteration-count 规定动画应该播放的次数。
animation-direction 规定是否应该轮流反向播放动画。

声明:博客中如无特殊说明或标注的文章均为博客原创文章,部分文章来源互联网,如有侵犯您的版权,或者对零分博客发布的文章有异议,请来信告知删除、修改,如您有好的建议或者意见也可以来信,谢谢!

请TA喝杯水^_^ 如本文“对您有用”,欢迎随意打赏,让我们坚持创作! 请TA喝水