我有一个日历 http://arshaw.com/fullcalendar/ :
$('#calendar').fullCalendar({
height: 300,
//.............
events: jsonData,
month: firstMonth
})
我想根据 jsonData
中每个值(元素)的某些条件动态设置事件的 color
。我该怎么做?
请注意,我不能这样做:
eventSources: [
{
events: [
{
title : 'event1',
start : '2012-06-10'
}
],
backgroundColor: 'green',
textColor: 'yellow'
},
之类的,因为在传递给日历之前我必须将 jsonData
分成两部分,然后将它们分别传递给日历。我不想要这个。相反,我想要一些回调函数,我可以在其中访问每个元素并设置事件的颜色。类似于 eventMouseover
。
最佳答案
关于javascript - 在完整日历中指定事件的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21793932/