简体   繁体   English

如何在JQuery FullCalendar中更改特定事件的背景颜色

[英]How can I change the specefic event background color in JQuery FullCalendar

How can I change the event background color while on rendering events on calendar. 在日历上渲染事件时如何更改事件背景颜色。 How can I change specific event background color in javascript, I have assigned the event with id. 如何在javascript中更改特定事件的背景颜色,我已为事件分配了ID。

you may alter the " fc-event " values in the fullcalendar.css to change the default event background, 您可以更改fullcalendar.css的“ fc-event ”值以更改默认事件背景,

or you can add a new css class as follows: 或者您可以添加一个新的CSS类,如下所示:

.newtype,
.fc-agenda .newtype.fc-event-time,
.newtype a {
    border-style: solid;
    border-color: #6da;    /* default BORDER color (probably the same as background-color) */
    background-color: #6da; /* #36c; default BACKGROUND color */
    color: #fff;            /* default TEXT color */
}

and specify it to the event throught className : 并通过className将其指定给事件:

event.className="newtype";

ps you need get the event object by function .fullCalendar( 'clientEvents', event_id) first ps您需要先通过函数.fullCalendar( 'clientEvents', event_id)获取事件对象

Good luck 祝好运

would make sure the event has a specific "className" and then color it through css. 将确保事件具有特定的“ className”,然后通过css对其进行着色。 more info here: http://arshaw.com/fullcalendar/docs/event_rendering/Colors/ 此处提供更多信息: http : //arshaw.com/fullcalendar/docs/event_rendering/Colors/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改 fullcalendar 中的背景颜色 - How can I change background color in fullcalendar jQuery fullcalendar:如何定位和更改不属于当前月份的日期的背景色? - jQuery fullcalendar: How can I target and change the background color of the days that don't belong to the current month? JQuery Calendar(http://arshaw.com/fullcalendar/)如何更改选定的单元格背景颜色 - JQuery Calendar(http://arshaw.com/fullcalendar/) How can I Change the selected cell background color 如何仅以全日历方式更改选定日期的背景颜色? - How can I change background color only for selected days in fullcalendar? 如何使用jQuery更改背景颜色? - How can I change background color with jQuery? 如何在 fullcalendar 中使用不同的 colors 更改事件的背景颜色? - How do I change an event's background color with different colors, in fullcalendar? 在全日历中单击更改事件的背景颜色 - Change background color of event on click in fullcalendar jQuery FullCalendar以编程方式更改事件呈现颜色 - jQuery FullCalendar programmatically change event rendering color 我们如何在带有jquery的全日历中为具有事件的单元格赋予单独的颜色? - How can we give separate color for the cells with event in a fullcalendar with jquery? 如何使用jquery或css更改滑块的背景颜色 - how can I change the background color of slider using jquery or css
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM