I recently started using the jQuery weekcalendar plugin to display a web-based calendar with appointments. The CSS code below is used to set the color of all events:
.wc-cal-event {
background-color: #00BFFF;
font-size: 0.8em;
position: absolute;
text-align: center;
overflow: hidden;
cursor: pointer;
color: #000;
width: 100%;
border: 1px solid #000;
font-weight: normal;
}
I have added a new feature where each appointment in the calendar has a category, similar to Outlook. I want the background color of the appointment to change based on its category, for example, it should be red.
How can I dynamically change the background color of an event? If I modify .wc-cal-event
, it affects every event's background color.
Thank you for your assistance.