【问题标题】:Fullcalendar change color of some events全日历更改某些事件的颜色
【发布时间】:2010-04-23 14:12:51
【问题描述】:

我需要更改 Fullcalendar 插件中某些事件的颜色。

我在“events”对象的构造函数中尝试了“className”属性。但是,我无法更改颜色和 CSS。我检查了萤火虫。事件 td 的 css 仍然使用默认 css。

我正在使用 RegisterClientScriptBlock 在代码隐藏中生成日历。也许这可能是一个问题,但我不这么认为。你怎么看?

【问题讨论】:

    标签: jquery fullcalendar


    【解决方案1】:

    对于类名称“other”,我已使用以下 CSS。起初,我错过了一个选择器,并且遇到了与您相同的问题。

    .other, .fc-agenda .other .fc-event-time, .other a {
        background-color: #066333;/* background color */
        border-color: #066333;/* border color (often same as background-color) */
        color: #fff;/* text color */
    }     
    

    【讨论】:

    • 是的。我为这个问题创建了一堆新的 CSS 类。只改变颜色是不够的。
    【解决方案2】:

    在使用像$("."+calEvent.id).addClass("classWithDifferentCSS"); 这样的jQuery 的addClass 之前,我已经实现了这一点。每个cal 事件都有一个带有其ID 的类。

    【讨论】:

      猜你喜欢
      • 2016-03-16
      • 1970-01-01
      • 1970-01-01
      • 2011-08-05
      • 1970-01-01
      • 1970-01-01
      • 2011-06-30
      • 1970-01-01
      • 2015-02-03
      相关资源
      最近更新 更多