jquery fadeout事件侦听器 [英] jquery fadeout event listener

查看:165
本文介绍了jquery fadeout事件侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的自编码的音符,我现在需要附加事件监听器到现有的fadeout事件。我可以绑定一个新的fadout监听器到现有的监听器吗?这怎么做? 这里是协奏曲ia jsFiddle

解决方案

如其他人所说,没有一个 fadeout 事件 - 你可以创建自己的事件 - 你会添加到回调code> fadeout :

  $(currentSlide).fadeOut(normal,function ){
//你的其他代码
$(this).trigger('myFadeOutEvent');
});

那么你需要听事件



('myFadeOutEvent',function(){
//做某事
}); $($。

看到 .trigger() 的详细信息


I have an existing self coded accordian that i now need to attach an event listener to an existing fadeout event. Can I bind a new fadout listener to an existing one? And how is this done? Here is the accordian i a jsFiddle

解决方案

As others have said there isnt a fadeout event - you could create your own event though - you would add it to the callback for fadeout :

$(currentSlide).fadeOut("normal", function () {
    // your other code
    $(this).trigger('myFadeOutEvent');
});    

then you would need to listen for the event

 $('.class').on('myFadeOutEvent',function() {
    // do something
 });

See the docs for .trigger() for details

这篇关于jquery fadeout事件侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆