Skip to content Skip to sidebar Skip to footer

Changing The Background Color Of An Event In Full Calendar With Right Click - Not Working

All the events in the full calendar are denoted by the class .fc-event and when I want to bind the right click functionality to .fc-event it does not work and the prevent default a

Solution 1:

It seems you got a bit confused? I've done some fixes to your code as I think it should be.

 // If the menu element is clicked
$("ul.custom-menu li").click(function() {

 // $event.css('background-color', color);
 switch($(this).attr("data-action")) {


    case "red": 

     // You're were getting the value of "data-color" and saving it into $event
     // also you were assigning variable red, not the string
     //var $event = $(".fc-event");
     $(this).css("background-color","red");
     //   alert("first"); break;

    case "green": 

  //  alert("second"); break;

 }
  $(".custom-menu").hide(100);
});

Post a Comment for "Changing The Background Color Of An Event In Full Calendar With Right Click - Not Working"