在FullCalendar(jquery)中为事件添加漂亮的颜色 [英] Adding nice colors to events in FullCalendar (jquery)

查看:5465
本文介绍了在FullCalendar(jquery)中为事件添加漂亮的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的日历中,我想用不同的颜色为每个事件着色。目前是否有一种方法可以发送到完整的日历,在JSON中它期望一个颜色的值?

FullCalendar

In my calendar I want to colour each event in a different colour. Is there currently a way to send to the full calendar, in the JSON it expects a value for a colour?
FullCalendar

推荐答案

似乎我错过了第一次阅读手册:

Seems I missed it the first time I read the manual:

我每天发送以下JSON:

I send for each day the following JSON:

{"id":"1",
"start":"1272513600",
"end":"1272513600",
"allDay":"1",
"title":"Repeat 1,Day 1",
"className":"eventColorX"}

重要的是className和X是一个数字(取决于CSS,见下文)。

然后在CSS中:

The important thing is the className and where the X is a number (depends on the CSS, see below).
And then in the CSS:

.eventColor1,
.fc-agenda .eventColor1 .fc-event-time,
.eventColor1 a {
    background-color: green; /* background color */
    border-color: green;     /* border color */
    color: yellow;           /* text color */
    }

.eventColor2,
.fc-agenda .eventColor2 .fc-event-time,
.eventColor2 a {
     background-color: purple; /* background color */
     border-color: purple;     /* border color */
     color: white;           /* text color */
     }


.
.
.
.

这篇关于在FullCalendar(jquery)中为事件添加漂亮的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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