Is it possible to do alternating row background colours in FullCalendar?

后端 未结 4 1574
执念已碎
执念已碎 2021-01-25 06:41

I applied an odd/even class to the fc-agenda-slot tr\'s, but the problem is the left/right \"cell\" border is on the fc-agenda-days table which is below, so it\'s not shown when

4条回答
  •  -上瘾入骨i
    2021-01-25 07:23

    Kind of late, but add this to your CSS

    .fc-agenda-slots tr.d1 td {
        background-color: rgba(79, 129, 128, .2); color: black;
    }
    

    and this in your JS to execute right after you render your calendar.

    $("table tr").each(function () {
         var i = $("table tr").index($(this));
         if (i % 4 == 1 || i % 4 == 2)
            $(this).addClass("d1");
    });
    

    btw this is only for week view.

提交回复
热议问题