jquery fadeout事件侦听器 [英] jquery fadeout event listener
本文介绍了jquery fadeout事件侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
如其他人所说,没有一个 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屋!
查看全文