gpt4 book ai didi

jquery - 如何在其他动画回调函数中检查动画是否完成?

转载 作者:行者123 更新时间:2023-12-01 03:18:18 25 4
gpt4 key购买 nike

$("#IMAGE1").animate({"left": "+=1050px", queue: false}, "slow", function()
{
// Want this to happen when the image2 animation is completed as well.
$("#IMAGE1").css('left', $('#IMAGE2').position().left);
}

$("#IMAGE2").animate({"left": "+=1050px", queue: false}, "slow");

如何在 image1.animation 的回调函数体内检查 image2.animation 何时完成?

最佳答案

您可以使用:animated选择器:

if ($('#IMAGE1').is(':animated')) {
// it's animating...
}

引用文献:

关于jquery - 如何在其他动画回调函数中检查动画是否完成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13040287/

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