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

css动画animation

零分教程1992023-01-31 00:54

使用简写属性,将动画与 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 规定是否应该轮流反向播放动画。
END
零分站龄16年资深站长
一个喜欢折腾,却又折腾不出像样东西的,不会PHP的PHP程序员!
2476
文章
13
分类
3774
标签
3
友链
onlinelovesky317355746vipsever@vip.qq.com