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

本文标签: javascriptAdd image to an eventFull CalendarStack Overflow