如何同时运行两个 jQuery 动画? - How to run two jQuery animations simultaneously?

10/14 05:56
阅读数 0

问题:

Is it possible to run two animations on two different elements simultaneously?是否可以同时在两个不同的元素上运行两个动画? I need the opposite of this question Jquery queueing animations .我需要这个问题的反面Jquery queuing animations

I need to do something like this...我需要做这样的事情......

$('#first').animate({ width: 200 }, 200);
$('#second').animate({ width: 600 }, 200);

but to run those two at the same time.但同时运行这两个。 The only thing I could think of would be using setTimeout once for each animation, but I don't think it is the best solution.我唯一能想到的就是对每个动画使用setTimeout一次,但我认为这不是最好的解决方案。


解决方案:

参考一: https://en.stackoom.com/question/5FWG
参考二: https://stackoom.com/question/5FWG
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部