gpt4 book ai didi

jquery - 多个元素的 jquery 动画回调

转载 作者:行者123 更新时间:2023-12-01 00:19:41 26 4
gpt4 key购买 nike

正如您在 this Fiddle 中看到的那样,我同时为多个元素设置动画,这正如我所愿。但在下一步中,我想在所有元素的动画结束后执行一些操作。使用complete-function似乎不可能,因为它是为每个完成的动画(3个元素,3次完整回调)触发的。 jquery .animate() API 还表示:

If multiple elements are animated, the callback is executed once per matched element, not once for the animation as a whole.

那么,您知道如何在每个动画完成时触发事件吗?

最佳答案

...animate(...).promise().done(function(){console.log("animate complete!")})

关于jquery - 多个元素的 jquery 动画回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10113528/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com