fullcalendar backgroundColor属性

时间:2013-10-10 10:04:51

标签: fullcalendar

我正在尝试为事件添加背景颜色,但没有运气。

$('#calendar').fullCalendar('renderEvent', { id: 1, title: 'hello', start: selected_date, allDay: true, color: '#FF0000', backgroundColor: '#000000' }, false);

知道为什么这不起作用?边框颜色似乎有效,但不是backgroundColor

6 个答案:

答案 0 :(得分:11)

如果添加两个样式表,那么backgroundColor将无效。

<link rel="Stylesheet" type="text/css" href="/Content/fullcalendar/fullcalendar.css" />
<link rel="Stylesheet" type="text/css" href="/Content/fullcalendar/fullcalendar.print.css")" />

删除fullcalendar.print.css后,backgroundColor决定正确渲染。

答案 1 :(得分:1)

添加媒体属性

    <link href="../css/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css" />
    <link media='print' href="../css/fullcalendar/fullcalendar.print.css" rel="stylesheet" type="text/css"  />

我在asp中的bundle配置中设置了它,但是没有添加媒体属性所以这是一个问题。

答案 2 :(得分:0)

事件的背景颜色在fullcalendar.css文件的

部分下定义
/* Global Event Styles 

(第261行,版本2.0测试版)

您可以通过以下方式以编程方式访问它:

$('.fc-event').css('background-color','#3a87ad');   

答案 3 :(得分:0)

尝试使其坚持(最后将false参数更改为true),可能是新事件重叠并使其更改属性。 &#34;通常,一旦日历重新获取其事件源(例如:单击prev / next时),事件将消失。但是,将stick指定为true将导致事件永久固定到日历。&#34;,来自文档,http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/

答案 4 :(得分:0)

我是这样做的:我将backgroundColor放在图表事件中:

chart: { 
    type: 'column',
    backgroundColor: 'transparent'
},

答案 5 :(得分:-3)

试试这可能对你有用。

 background: '#eeeef0  

不要写backgroundColor。

相关问题