更改EventSource背景和文本颜色fullcalendar

时间:2014-12-31 18:17:42

标签: jquery fullcalendar

如何以数组形式更改eventSources的背景颜色?

<script>
var curSource = new Array();
//first source uses querystring to determine what events to pull back
curSource[0] = "<?php echo site_url('home/calendarListReferrals/') ?>";
//second source just returns all events
curSource[1] = "<?php echo site_url('home/calendarListRequests/') ?>";
var newSource = new Array(); //we'll use this later

$(document).ready(function() {     
    $('#calendar').fullCalendar({
        height: 600,
        eventSources: [curSource[0],curSource[1]],
        header: {
            left: 'prev',
            center: 'title',
            right: 'next'
        },

curSource [0]和curSource [1]应该有不同的颜色。

1 个答案:

答案 0 :(得分:1)

这是我所做的,谢谢你的回应。

$(document).ready(function() {     
    $('#calendar').fullCalendar({
        lang: 'en',
        eventSources: [

        {
            url: curSource[0],
            type: 'POST',
            error: function() {
                alert('there was an error while fetching events!');
            },
            color: 'yellow',
            textColor: 'black'
        },
        {
            url: curSource[1],
            type: 'POST',
            error: function() {
                alert('there was an error while fetching events!');
            },
            color: 'blue',
            textColor: 'white'
        }
        ],