$("#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...
}


参考文献:


:animated selector

10-07 17:33