【发布时间】:2015-07-02 11:24:28
【问题描述】:
我在让两个转换一起工作时遇到问题。
第二个动画(部分)有效,但摆动效果似乎在一段时间后重置并停止重复,第一个动画根本不起作用。
这是我的动画代码:
.box{
width:250px; height:50px;
background:blue;
border: 1px solid black;
position:fixed;
left: 50%;
margin-left:-125px;
top:0px;
animation-name: fall;
animation-duration: 1.5s;
animation-timing-function: ease-in;
animation-name: swing;
animation-duration: 4s;
animation-iteration-count:infinte;
animation-timing-function: ease-in-out;
animation-delay: 1.4s;
}
@-moz-keyframes fall{
from {top: -50px;}
to {top: 0px;}
}
@-webkit-keyframes fall{
from {top: -50px;}
to {top: 0px;}
}
@-moz-keyframes swing{
-moz-transform-origin: center top;
0%{-moz-transform:rotate(-3deg)}
50%{-moz-transform:rotate(-2deg)}
100%{-moz-transform:rotate(-3deg)}
}
@-webkit-keyframes swing{
-webkit-transform-origin:center top;
0%{-webkit-transform:rotate(-3deg)}
50%{-webkit-transform:rotate(-2deg)}
100%{-webkit-transform:rotate(-3deg)}
}
可以在此处找到显示问题的演示:http://jsfiddle.net/akwbmw86/
我在这里做错了什么?
【问题讨论】:
标签: css animation css-transitions