简体   繁体   中英

How can I change the specefic event background color in JQuery FullCalendar

How can I change the event background color while on rendering events on calendar. How can I change specific event background color in javascript, I have assigned the event with id.

you may alter the " fc-event " values in the fullcalendar.css to change the default event background,

or you can add a new css class as follows:

.newtype,
.fc-agenda .newtype.fc-event-time,
.newtype a {
    border-style: solid;
    border-color: #6da;    /* default BORDER color (probably the same as background-color) */
    background-color: #6da; /* #36c; default BACKGROUND color */
    color: #fff;            /* default TEXT color */
}

and specify it to the event throught className :

event.className="newtype";

ps you need get the event object by function .fullCalendar( 'clientEvents', event_id) first

Good luck

would make sure the event has a specific "className" and then color it through css. more info here: http://arshaw.com/fullcalendar/docs/event_rendering/Colors/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM