jquery - 在与 animationend 绑定(bind)的函数之前延迟

标签 jquery html css

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

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

});

最佳答案

如果我没理解错的话,你想延迟 addClass 对吧?

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

    var delay = 500; // delay in milliseconds

    setTimeout(function() {
        $("#Img2").addClass("fadeOutRight animated");
    }, delay);
}); 

关于jquery - 在与 animationend 绑定(bind)的函数之前延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19314123/

相关文章:

javascript - 找到最后获得焦点的元素

javascript - 使用 jQuery.ajax 的 HEADERS_RECEIVED 的 readState 事件

jquery - Sublime 视频播放器无法在 IE9 中调整大小

html - 为什么 td border-radius 应用于内容而不是边框

CSS如何获得页眉和页脚之间的高度?

javascript - jQuery 数据表 - 意外的垂直滚动条

jquery - 在查询字符串值中传递 # 时出错

javascript - 具有特定数字的输入类型范围

php - (PHP) 根据 mysql 值归类到 html opgroup

javascript - 使用 Javascript 选择表单中的最大选择数