Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery动画停止,等待一段时间,然后继续_Javascript_Jquery - Fatal编程技术网

Javascript jquery动画停止,等待一段时间,然后继续

Javascript jquery动画停止,等待一段时间,然后继续,javascript,jquery,Javascript,Jquery,我有一个机制,通过队列位置将元素移动到一个地方,每次设置火灾动画时,队列位置都会弹出 我希望动画等待一个固定的时间,然后再允许再次动画 $("#" + elemId).animate({ top: that.CallsQueue.pop() }, that.SecondForEntireTrack, function () { }); //here i want to implement waiting befor another animat

我有一个机制,通过队列位置将元素移动到一个地方,每次设置火灾动画时,队列位置都会弹出

我希望动画等待一个固定的时间,然后再允许再次动画

    $("#" + elemId).animate({
        top: that.CallsQueue.pop()
    }, that.SecondForEntireTrack, function () {

    });
    //here i want to implement waiting befor another animat huppen
尝试
setTimeout(函数(){},time)
函数。 更多信息请参见->

使用两个动画

$("#" + elemId).animate(
    {
        top: that.CallsQueue.pop()
    },
    that.SecondForEntireTrack,
    function () {
        secondAnimation(elemId, that);
    }
);

function secondAnimation(elemId, that) {
    setTimeout(
      function () {
        $("#" + elemId).animate(
            {
                left: that.CallsQueue.pop()
        },
        that.SecondForEntireTrack
     },
     800000
   );
);
}

分享您尝试实施的内容。如果是基于时间间隔的等待,您可以按照@martin的回答设置超时