javascript - Add image to an event - Full Calendar - Stack Overflow

I have a json file with events, which are loaded in fullcalendar.js . I want to add an image to each ev

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 badges
Add a ment  | 

1 Answer 1

Reset to default 4

I 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745287543a4620653.html

相关推荐

  • javascript - Add image to an event - Full Calendar - Stack Overflow

    I have a json file with events, which are loaded in fullcalendar.js . I want to add an image to each ev

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信