我正在使用 fullcalendar 插件。我使用了 jquery .on() 函数使图标可单击,但问题是当我单击放置在事件上的图标时,也会触发 fullcalendar 插件的 eventClick 方法。当我单击全日历月 View 上的事件上的图标时,我不希望触发 eventClick 方法。有人遇到过类似的问题吗?无论如何,仅当单击事件上的图标时才禁用 eventClick 方法。我尝试使用 .unbind() 函数,但仍然触发了 EvenClick 方法以及用于使图标可点击的 .on() 函数。
最佳答案
最后在图标的点击事件中,您可以取消该事件到 DoomTree 的传播。
示例:http://api.jquery.com/event.stopImmediatePropagation/
$(".icons").on("click", function(event){
event.stopImmediatePropagation();
});
或者:http://api.jquery.com/event.stopPropagation/
$(".icons").on("click", function(event){
event.stopPropagation();
// do something
});
关于javascript - fullcalendar 为事件上放置的可点击图标解除绑定(bind) eventClick 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12002468/