Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/435.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 更改已单击的特定日期的颜色_Javascript_Jquery_Spring Mvc - Fatal编程技术网

Javascript 更改已单击的特定日期的颜色

Javascript 更改已单击的特定日期的颜色,javascript,jquery,spring-mvc,Javascript,Jquery,Spring Mvc,如何更改日历上单击的特定日期的颜色 这是我的代码: selectable: true, selectHelper: true, select: function(calEvent, jsEvent, view) { var moment = $('#calendar').fullCalendar('getDate'); /** * calEvent is the event object, so you can access it's properties

如何更改日历上单击的特定日期的颜色

这是我的代码:

selectable: true,
selectHelper: true,
select: function(calEvent, jsEvent, view) { 
    var moment = $('#calendar').fullCalendar('getDate');
    /**
      * calEvent is the event object, so you can access it's properties
      */
    if(confirm("Would you like to cancel the meal delivery ?")){  
        delete event in backend
        jQuery.post("/vacation/deleteEvent", { "id": calEvent.id } );

        delete in frontend
        $(this).css('border-color', 'red'); 
    }
}, 

对于我想您正在使用的JQuery插件fullcalendar,您可以通过他的标题更改特定日期的颜色,如下所示:

eventRender: function(event, element) {
    $where = event.title;
    if ($where == 'your title') 
        element.css('background-color', '#bbd2e1');
    else
        element.css('background-color', '#f0c0cb');
            }

问题是什么?