javascript - 使用 animate.css 和 jquery 的顺序动画

标签 javascript jquery css

如何让它们按顺序淡入淡出?

演示 http://jsfiddle.net/uz2rm8jy/4/

HTML

<div class="c one"></div>

<div class="c two"></div>

<div class="c three"></div>

我的 js

$(function() {
$('.c').each(function(i) {
$(this).delay((i++) * 150).addClass('fadeInUp'); })
});

最佳答案

您可以通过使用 jquery 的 fadeTo 使用与您已经存在的完全相同的逻辑来实现这一点...

$(function() {
  $('.c').each(function(i) {
  $(this).delay((i++) * 150).fadeTo(500,1); })
});

$(function() {
$('.c').each(function(i) {
$(this).delay((i++) * 150).fadeTo(500,1); })
});
.one,.two,.three {
    height: 50px;
    background: #dddddd;
    width: 50px;
    border-radius: 50%;
    display:inline-block;
    margin: auto 10px;
    opacity:0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<div class="c one"></div>

<div class="c two"></div>

<div class="c three"></div>

关于javascript - 使用 animate.css 和 jquery 的顺序动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28039526/

相关文章:

javascript - 未捕获的 SecurityError : Blocked a frame with origin "null" from accessing a frame with origin "null". 协议(protocol)、域和端口必须匹配

javascript - 嵌套每个循环导致问题

javascript - 如何使用 AJAX 显示结果

javascript - 通过循环遍历数组来填充表单

html - 在 <li> 中对齐 3 个元素时出现问题

html - 为什么还有空格?

javascript - JQuery show element 其中有一个元素的类在

javascript - 在光标处插入 react

jquery - 嵌套 Jquery 选择器

CSS 问题 : extra white space on the right of all my content