我做了一个demo在 JS Fiddle 上。
正如您在演示中看到的,两个动画同步移动。
如果我想在顶部动画开始移动后 0.5 秒开始底部动画怎么办?
如何修改我的代码?
这是 textillate plugin 的文档
<h1 class="tlt">
<ul class="texts">
<li data-in-effect="fadeInDown" data-out-effect="fadeOutDown" data-in-delay="10">Some Title</li>
<li data-in-effect="fadeInDown" data-out-effect="fadeOutDown" data-in-delay="10">Another Title</li>
<li data-in-effect="fadeInDown" data-out-effect="fadeOutDown" data-in-delay="10">Last Title</li>
</ul>
</h1>
<h1 class="tlt">
<ul class="texts">
<li data-in-effect="fadeInDown" data-out-effect="fadeOutDown" data-in-delay="10">Some Title</li>
<li data-in-effect="fadeInDown" data-out-effect="fadeOutDown" data-in-delay="10">Another Title</li>
<li data-in-effect="fadeInDown" data-out-effect="fadeOutDown" data-in-delay="10">Last Title</li>
</ul>
</h1>
最佳答案
我把你的第二个 tlt
变成了 tlt2
并在上面调用了 textillate,除了 initialDelay
参数。
<h1 class="tlt2">
....
// JavaScript
$('.tlt2').textillate({
initialDelay: 500,
....
关于javascript - 我怎样才能异步运行两个正在运行的jquery?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31432580/