如何检查jquery fx队列中是否存在任何挂起的动画

如何检查jquery fx队列中是否存在任何挂起的动画,jquery,Jquery,我在做类似的事情 $("somethreedivs").animate( { //move the three divs to the left},1000 ).promise().done(function() { //hide the leftmost div //introduce a new div in the right }); 我想在上面指定的动画之前检查“如果任何动画不完整,不要尝试执行指定的效果” 我想把

我在做类似的事情

$("somethreedivs").animate(

    { //move the three divs to the left},1000


 ).promise().done(function()
     {
        //hide the leftmost div
        //introduce a new div in the right


     });
我想在上面指定的动画之前检查“如果任何动画不完整,不要尝试执行指定的效果”

我想把上面的“如果检查”放在我的动画代码之前,以便 如果任何动画处于挂起状态,请避免动画。整个想法是新的 仅当上一个动画效果被激活时,才应触发动画 完成我从指定“queue:false”中了解到,触发的任何新动画都不会等待上一个动画完成,这不是我的场景

使用:

尝试:


不太确定您在这里得到了什么,但是您可以在实际的
.animate(function(){//do effect}).promise().done(function(){//do other})中调用函数此外,您可以将其放入函数中,并在动画完成后递归执行每个动画。我需要确切地知道你打算制作什么动画。。。是否一次设置一个div的动画(在左侧)?你不想让这些div同时动画吗?如果是这样,那么我们可以将元素索引作为参数传递到函数中,并将其用于动画。不过我需要看看DOM是如何设置的。谢谢,我从没想过会这么简单。Jquery试图“少写,多做”,我希望在动画效果出现之前进行检查。您的检查逻辑在回调方法中。感谢您的回复。如果条件总是返回true。检查动画方法本身内部是否存在任何动画元素。
if("what condition to be given here/how to check the animation queue"){
    return;
}
if($(somethreedivs).is(':animated').length>0){
  //return from here
  }
$("somethreedivs").animate(

{ //move the three divs to the left},1000

).promise().done(function()
 {

    //hide the leftmost div
    //introduce a new div in the right
 });
if($(":animated").length)