animation - CSS 动画 : Load second keyframe after first

标签 animation css keyframe css-animations

我学习 CSS 动画,我有一个问题。

这是我的例子:

http://jsfiddle.net/MBJbB/ 注意:只能在 WebKit 浏览器中工作。

我有 2 个关键帧。我设置“first”重复 3 次。

运行完第3次的“第一个”关键帧后,我想调用“第二个”无限次。

最佳答案

编辑:joshuanhibbert 的回答更优雅。使用它。

$("#ball").bind("webkitAnimationEnd oAnimationEnd msAnimationEnd animationend", function(){
  $(this).addClass("infinite");
});

还有你的 CSS

#ball.infinite {
  -webkit-animation: second 1s ease-in 0 infinite alternate;
  -moz-animation: second 1s ease-in 0 infinite alternate;
  -o-animation: second 1s ease-in 0 infinite alternate;
  -ms-animation: second 1s ease-in 0 infinite alternate;
  animation: second 1s ease-in 0 infinite alternate;
}

JSfiddle:http://jsfiddle.net/K74TW/

关于animation - CSS 动画 : Load second keyframe after first,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7720159/

相关文章:

CSS transition and transform from hamburger bars --> 点击 X(使用手写笔)

css - SCSS编译从CSS移除-webkit和-ms属性

javascript - 确定 flexbox 的所需宽度

html - 条纹 table 上的背景颜色褪色

java - ArcShape 的 Android 自定义动画

ios - UISegmentedControl 的动画栏按钮没有移动?

html - CSS3 关键帧和变换不能正确显示立方体

css - css动画之间的平滑过渡

ios - 无论如何要将 UIImageView 的 contentMode 从 aspectFill 动画化到 aspectFit?

css - 最小高度 css 在 Outlook 2007 时事通讯中不起作用