gpt4 book ai didi

javascript - fullcalendar 两类制日历,着色周

转载 作者:行者123 更新时间:2023-12-01 00:11:25 25 4
gpt4 key购买 nike

在fullcalendar中是否可以制作双色日历,奇数周为x颜色,偶数周为y颜色?

https://fullcalendar.io/#demos

像这样:

enter image description here

最佳答案

据我所知,FC 的 html 结构中有类似的内容:

<div class="fc-day-grid">
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
<!-- other similar blocks of weeks-rows like above -->
</div>

您可以自定义 fc-day-grid 的每个偶数子级的 fc-bg 类,例如

.fc-row:nth-child(even) .fc-bg {
background-color: #fcf8e3;
}

查看代码片段中的示例。

.fc-day-grid .fc-bg {
height: 50px;
border: solid 1px black
}

.fc-row:nth-child(even) .fc-bg {
background-color: #fcf8e3;
}
<div class="fc-day-grid">
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
<div class="fc-row fc-week">
<div class="fc-bg">
<!-- other fc elements-->
</div>
</div>
</div>

关于javascript - fullcalendar 两类制日历,着色周,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60047613/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com