开发者

JQuery DatePicker background color

I am using an example of JQuery DatePicker from link text

on my asp.net page.

But, background color of the datepicker is white. I am not sure开发者_如何学编程 how to change this. (Change to default color) My asp.net page background page is white, maybe because of that?

Any help would be appereicate it. Thanks.


The background formatting for the control comes from the .ui-widget-content CSS class. Assuming you only want to apply to the date picker and not other controls you want something like this:

.ui-datepicker .ui-widget-content {
    background: #999 none;
}

If instead you want to change the background colour for all controls, just find the existing .ui-widget-content class in your CSS and change that.


Just Add this one line of code into your jquery ui css file

.ui-datepicker .ui-datepicker-title select{color: #000;}

This will solve your problem.


You can change the background color of DatePicker via the CSS file which come with the package. Locate for class selector .ui-widget-content, there should be background attribute which you can change to your liking.


with this function you can color the days you want:

$("#dater").datepicker({
    numberOfMonths: 3,   
});
function ColorDay(month, day, year, backgroundColor)
{
    day--;
    $("[onclick*='"+month+","+year+"'] [class*=ui-state-default]").eq(day).css("background",backgroundColor); 

}

then to color a day do:

ColorDay(6,30,2012,"yellow"); // color July 30, 2012   of yellow


How about try this code

 a.ui-state-default{
   background-color: red !important;
 } 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜