如何在fullcalendar中以不同颜色更改事件背景颜色? [英] How I change events background color with different colors, in fullcalendar?

查看:409
本文介绍了如何在fullcalendar中以不同颜色更改事件背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 fullcalendar 的最新版本,我查看了文档如何更改背景颜色事件,但我不知道如何制作不同的事件。

I需要带有事件红色,蓝色,绿色的代码示例,就像pic一样。


我在文档站点看到这段代码,但是我不能应用2种颜色:

  $('#calendar')。fullCalendar({
editable:true,events:[
{
title:'Teste1',
start:新日期(y,m,d,10,30),
allDay:false,
可编辑:false
},
{
title:'Teste2',
start:new Date(y,m,d,11,40),
allDay:false
}],eventColor:'# 378006'});


解决方案

由于您使用的是最新版本(1.5)您可以设置 backgroundColor 属性。

  {
title :'Teste1',
start:new Date(y,m,d,10,30),
allDay:false,
editable:false,
backgroundColor:'#SomeColor '
},
{
title:'Teste2',
start:new Date(y,m,d,11,40),
allDay:false,
backgroundColor:'#SomeOtherColor'
}

您也可以设置 textColor 属性,如果您需要更改它。


I'm using the last version of fullcalendar, I looked on documentation how change background color event, but I don't know how make to diferent events.
I need for code sample with events red, blue, green, like the pic.

I see this code, on document site, but I can't to apply 2 colors:

    $('#calendar').fullCalendar({
        editable: true,             events: [
            {
                title: 'Teste1',
                start: new Date(y, m, d, 10, 30),
                allDay: false,
                 editable: false
            },
            {
                title: 'Teste2',
                start: new Date(y, m, d, 11, 40),
                allDay: false
            }           ], eventColor: '#378006'        });

解决方案

Since you are using the latest version (1.5), you can set the backgroundColor property.

{
  title: 'Teste1',
  start: new Date(y, m, d, 10, 30),
  allDay: false,
  editable: false,
  backgroundColor: '#SomeColor'
},
{
  title: 'Teste2',
  start: new Date(y, m, d, 11, 40),
  allDay: false,
  backgroundColor: '#SomeOtherColor'
}   

You can also set the textColor property if you need to change that as well.

这篇关于如何在fullcalendar中以不同颜色更改事件背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆