admin管理员组文章数量:1418380
I have a json file with events, which are loaded in fullcalendar.js . I want to add an image to each event (before the timestamp of the event). I already looked up a solution on here: solution, but it didn't give me the answer because I think fullcalendar updated after that.
I like to know these things:
First of all: the 'img src' attribute, do I need to reference path from my HTML file or javascript file?
Second: I think the .fc-event-title tag was removed from the CSS file, because I can't seem to find in the CSS file.
Thanks in advance and sorry for the lack of knowledge.
I have a json file with events, which are loaded in fullcalendar.js . I want to add an image to each event (before the timestamp of the event). I already looked up a solution on here: solution, but it didn't give me the answer because I think fullcalendar updated after that.
I like to know these things:
First of all: the 'img src' attribute, do I need to reference path from my HTML file or javascript file?
Second: I think the .fc-event-title tag was removed from the CSS file, because I can't seem to find in the CSS file.
Thanks in advance and sorry for the lack of knowledge.
Share Improve this question edited May 23, 2017 at 10:27 CommunityBot 11 silver badge asked Nov 17, 2014 at 16:07 username_HIusername_HI 1151 gold badge2 silver badges5 bronze badges1 Answer
Reset to default 4I make it in the eventRender function (in json i have a event.icon):
eventRender: function(event, element, view) {
if(event.icon){
if(event.allDay){
$(element).find('span:first').prepend('<img src="./fileadmin/images/layout/'+event.icon+'" />');
}else{
$(element).find('.fc-time').prepend('<img src="./fileadmin/images/layout/'+event.icon+'" />');
}
}
},
And your second que: Yes i have updated fullcalendar too, and some class names changed to a shorter version.
本文标签: javascriptAdd image to an eventFull CalendarStack Overflow
版权声明:本文标题:javascript - Add image to an event - Full Calendar - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745287542a2651589.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论