Imran
Imran

Reputation: 51

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.

Upvotes: 4

Views: 3834

Answers (2)

CAI
CAI

Reputation: 19

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";

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

Good luck

Upvotes: 1

arshaw
arshaw

Reputation: 2725

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/

Upvotes: 1

Related Questions