我已经使用 Ext.ux.touchcalendar https://github.com/SwarmOnline/Ext.ux.TouchCalendar 实现了日历.我想将一些单元格的颜色更改为绿色,一些单元格的颜色更改为红色,一些单元格的颜色更改为蓝色有人能告诉我该怎么做吗?
当我尝试在skin.css中添加以下CSS时
.touch-calendar-view table.day tr :nth-child(3) td:nth-child(5).time-block { /* Selects third row, then select fifth cell. */
background-color: green!important;
}
谢谢
最佳答案
日历单元格分为多个表格行中的多个表格单元格。
您可以通过对表格行和包含的表格单元格使用 nth-child
来定位特定元素。下面的代码是一个模板,最好附加一些类而不是tr和td,这样不会影响其他表。
tr:nth-child(3) td:nth-child(5) { /* Selects third row, then select fifth cell. */
background: lightblue;
}
示例输出:
关于javascript - 如何在 sencha touch 中使用 Ext.ux.touchcalendar 中的 css 更改特定单元格颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33471744/