使用beforeShowDay修改jquery datepicker CSS
我使用 beforeShowDay
并已将课程 specialDay
指定给我日历中的特定日子;这工作正常,但我无法理解如何风格的类,以及如何从主题滚轮的CSS一般工作。我尝试过:
I am using beforeShowDay
and have assigned the class specialDay
to particular days in my calendar; this works fine, however I am having trouble understanding how to style the class and how the css from theme roller is working in general. I have tried:
td .specialDate {
background: #33CC66;
}
,但这不会影响日历的外观。任何想法?
but this has no affect on the look of the calendar. Any ideas?
我有同样的问题,幸运的是我发现了答案。
当禁用一天(设置为false)有效分配一个类(.specialDate)来更改背景颜色,但如果启用日期,则无效,因为我们有另一个样式锚a)覆盖分配给td锚的类。
I had the same problem, fortunately i found the answer. When you disable a day (set to "false") is valid to assign a class (".specialDate") to change the background color, but not if the date is enabled, because we have another styled anchor ("a") that overrides the class assigned to "td" anchor.
因此,如果您的日期已启用以选择并想要更改样式,则必须编辑继承a锚,像这样:
So, if your date is enabled to select and want to change the styles, you have to edit the inherited "a" anchor, like this:
.specialDate a { background: #33CC66 !important; }
添加!important 非常重要
希望这可以帮助你!