fullcalendar backgroundColor property

早过忘川 提交于 2019-12-05 16:02:24

If you add both the stylesheets then the backgroundColor will not work.

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

After removing the fullcalendar.print.css then the backgroundColor decided to render correctly.

Add the media attribute

    <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"  />

I was setting it up in my bundle config in asp but that didn't add the media property so it was an issue.

The background color for events is defined in the fullcalendar.css file under the section

/* Global Event Styles 

(Line 261, in version 2.0 beta)

You can access it programmatically like this:

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

Try to make it stick (change false parameter to true, at the end), probably a new event is overlapping and make it change properties. "Normally, the event will disappear once the calendar refetches its event sources (example: when prev/next is clicked). However, specifying stick as true will cause the event to be permanently fixed to the calendar.", from Documentation, http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/

Here is how I did it: I placed backgroundColor in the chart event:

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

try this may be it works for you.

 background: '#eeeef0  

Do not write backgroundColor.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!