完整的日历 - 将可点击的图标与事件相关联? [英] full calendar - associate clickable icons with events?

查看:141
本文介绍了完整的日历 - 将可点击的图标与事件相关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在日历上追加4个图标,每个事件。每个图标都应在点击事件中调用不同的功能。说实话,我不太擅长CSS。我尝试了下面的代码,但是这些图标的点击事件没有被调用。而是调用事件事件。无论如何要追加4个可点击事件的图标吗?提前感谢您

  eventRender:function(event,element,calEvent){
element.find(。fc (<< span class = \fc-event-icons \>< / span>)。html(< img src = \/ images / pass.png\onclick = \javascript:图标(+ this.id +); \/>< img src = \/images/pass.png\onclick = \javascript:图标(+ this.id +); \/>< img src = \/images/pass.png\onclick = \javascript:图标(+ this .id +); \/>< img src = \/images/pass.png\onclick = \javascript:图标(+ this.id +); \/> ;));
}


解决方案

我认为您需要使用 .on()函数将一个事件处理程序注册到您的图标中。 =http://jsfiddle.net/100thGear/rpc23/> http://jsfiddle.net/100thGear/rpc23/



点击事件被触发,并通过 .on()处理程序进行适当处理。让我知道这是否有帮助!


I want to append 4 icons each event on the calendar. Each icon should calls different function on click event. To be honest, I am not too good in CSS. I have tried the below code but the click event for these icon is not invoked. Instead events event is invoked. Is there anyway to append 4 icons with clickable event? Thank you in advance

eventRender: function(event,element,calEvent) {
    element.find(".fc-event-title").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"/images/pass.png\" onclick=\"javascript:icons("+this.id+");\" /><img src=\"/images/pass.png\" onclick=\"javascript:icons("+this.id+");\" /><img src=\"/images/pass.png\" onclick=\"javascript:icons("+this.id+");\" /><img src=\"/images/pass.png\" onclick=\"javascript:icons("+this.id+");\" />"));
}

解决方案

I think you need to use the .on() function to register an event handler to your icons.

Check this fiddle: http://jsfiddle.net/100thGear/rpc23/

The click events get triggered and are handled appropriately with the .on() handler. Let me know if this helps!

这篇关于完整的日历 - 将可点击的图标与事件相关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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