0

我想在与 Img1 动画完成绑定的函数执行之前设置延迟。

$(document).ready(function(){   
$("#Img1").bind.('animationend webkitAnimationEnd', function() {        
    $("#Img2").addClass("fadeOutRight animated");enter code here    
});     

});

4

2 回答 2

0

如果我对您的理解正确,您想延迟 addClass 对吗?

$(document).ready(function(){   
$("#Img1").bind.('animationend webkitAnimationEnd', function() {

    var delay = 500; // delay in milliseconds

    setTimeout(function() {
        $("#Img2").addClass("fadeOutRight animated");
    }, delay);
}); 
于 2013-10-11T08:59:49.740 回答
0

这是你想要的:

$("#img1").animate({
    //Do stuff.
},500).queue(function(){
     $("#Img2").addClass("fadeOutRight animated");
     $(this).dequeueu();
})
于 2013-10-11T09:01:05.747 回答