Currently, I have a script that allows me to change the color of an event in a calendar to red when clicked.
eventClick: function(calEvent, jsEvent, view) {
$(this).css('border-color', 'red');
}
Now, I want to enhance this feature by enabling the user to cycle through different colors with each click, starting from red and moving to green, then blue, yellow, etc.
eventClick: function(calEvent, jsEvent, view) {
if current color is red, change to green;
else if current color is green, change to blue;
etc.
}
Essentially, I need to determine the current color and switch it accordingly among a set of predefined colors, which will be limited to about 5 options.