JS Fullcalendar背景色未设置 [英] JS Fullcalendar background color not setting
本文介绍了JS Fullcalendar背景色未设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用FullCalendar JS设置事件的背景色 http://arshaw.com/fullcalendar/
I am trying to set the background color of an event with FullCalendar JS http://arshaw.com/fullcalendar/
这是我的JS:
<script>
$('#calendar').fullCalendar({
events: [
{
title: 'Test',
start: '2014-08-07',
url: '#',
backgroundColor: '#FF0000',
editable: true
},
]
});
</script>
这就是产生的东西
为什么它没有产生我想要的结果,事件背景颜色变为红色.
Why is it not producing the result I want, the event background colored as red.
推荐答案
您可以更改事件的backgroundColor属性,例如:
You can change the backgroundColor property for your events like:
$('#calendar').fullCalendar({
{
title: '1',
start: new Date(2014, 02, 25, 10, 30),
allDay: false,
editable: false,
backgroundColor: '#ED1317'
},
{
title: '2',
start: new Date(2014, 02, 26, 10, 30),
allDay: false,
editable: false,
backgroundColor: '#ED1317'
},
...
});
对于其他日期,只需使用.fc-future和.fc-today CSS属性:
For the other dates, just use the .fc-future and .fc-today CSS properties :
.fc-future,
.fc-today {
background-color: #10CC55;
}
已更新:
$('#calendar').fullCalendar({
eventSources: [
{
events: [
{
title : 'event1',
start : '2010-01-01'
},
{
title : 'event2',
start : '2010-01-05',
end : '2010-01-07'
},
{
title : 'event3',
start : '2010-01-09 12:30:00',
}
],
backgroundColor: '#ED1317'
}
]
这篇关于JS Fullcalendar背景色未设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文