我在應用程序中使用fullcalendar。我想通過單擊單元格來更改單元格背景顏色,但eventClick未被觸發。 任何人都可以幫助我。 這裏的代碼:fullCalendar eventClick沒有解僱
$(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
eventClick: function (event) {
alert('hello');
event.backgroundColor = 'yellow';
$(this).css('background-color', 'red');
},
header: {
left: 'prev,next today',
center: 'title',
right: 'agendaWeek'
},
editable: true,
defaultView: 'agendaWeek',
slotMinutes:60
});
});
您是否嘗試過[這](http://stackoverflow.com/questions/14657414/eventclick-change-background-color )和[這個](http://stackoverflow.com/questions/35797928/change-background-color-of-event-on-click-in-fullcalendar) – Bikee