2
我有一个用于将球向上和向下移动的css类。CSS3平滑地停止动画
.active_animation {
animation-duration: 5s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
cursor: pointer;
}
.paused_animation {
-ms-animation-play-state: paused;
-o-animation-play-state: paused;
-moz-animation-play-state: paused;
-webkit-animation-play-state: paused;
animation-play-state: paused;
}
<div class="active_animation">Ball</div>
动画工作正常,但是当我尝试使用jQuery的暂停(通过增加pause_animation到球)这个动画我不能将它移动到另一个位置。
如果我尝试删除.active_animation类,它不会平稳停止。
我的问题是我该如何暂停动画并有能力移动那个球?
请帮忙!!!
对于高级动画,最好使用一些动画里brary。就像https://greensock.com/tweenmax – Volvox
看看这篇文章[停止CSS动画](https://stackoverflow.com/questions/13061209/stopping-a-css-animation-but-letting-its-当前迭代精加工) –