在Datepicker上更改特定日期的单元格背景颜色的正确方法 [英] Correct way to change specific date's cell background-color on datepicker

查看:184
本文介绍了在Datepicker上更改特定日期的单元格背景颜色的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到许多答案 如何更改jquery日期选择器的单元格颜色 但是由于某些原因,它们不适用于我的示例.

I have seen many answers on the line of How to change the cell color of a jquery datepicker But they for some reason do not apply to my example.

http://plungjan.name/test/datepicker_orange.html

我希望整个单元格的内容都是橙色,而不只是我们在单元格中链接后面看到的内容

I want the WHOLE cell content to be orange, not just what we can see behind the link IN the cell

所以我可以看到

.ui-state-default {
  background: url("images/ui-bg_glass_75_e6e6e6_1x400.png") repeat-x scroll 50% 50% #E6E6E6;
  border: 1px solid #D3D3D3;
  color: #555555;
  font-weight: normal;
}

使用我设置为橙色"的类名称来控制单元格内部的链接

which controls the link inside the cell with a class name set by me to "orange"

<td class=" orange" onclick="DP_jQuery_1327604402271.datepicker._selectDay('#toDate',1,2012, this);return false;" title="Almost sold out">
<a class="ui-state-default" href="#">15</a>
</td>

我在这段代码中给了橙色班级:

where the orange class is given by me in this code:

return [true,"orange","Almost sold out"];

它显示

不是

如果我在萤火虫中删除上述ui-state-default的背景图像,那我能得到什么

Which I can get if I remove the background image of the above ui-state-default in firebug

更改我现在使用beforeShowDay更改的单元格的完整单元格颜色的正确方法是什么?

What is the correct method of changing the complete cell color of the cells I now change using the beforeShowDay?

我尝试通过覆盖默认值来帮助解决这种情况:

I tried helping the situation by overriding the default:

.ui-state-default {
  background-color: transparent;
  border: 1px solid #D3D3D3;
  color: #555555;
  font-weight: normal;
}

没有区别

推荐答案

@mplungjan将CSS更改为此:

@mplungjan Change css to this:

td.highlight {border: none !important;padding: 1px 0 1px 1px !important;background: none !important;overflow:hidden;}
td.highlight a {background: #99dd73 url(bg.png) 50% 50% repeat-x !important;  border: 1px #88a276 solid !important;}

这篇关于在Datepicker上更改特定日期的单元格背景颜色的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆