完整的日历 - 将可点击的图标与事件相关联? [英] full calendar - associate clickable icons with events?
问题描述
我想在日历上追加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屋!