jQuery的日历禁用的日期颜色(Jquery Calendar Disabled Date col

2019-10-18 01:00发布

我怎样才能改变禁用日期的背景颜色在五月红?

<input id="iDate">

<script type='text/javascript'>
var unavailableDates = ["9-5-2013", "14-5-2013", "15-5-2013"];

function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
if ($.inArray(dmy, unavailableDates) == -1) {
    return [true, ""];
} else {
    return [false, "", "Unavailable"];
}
}

$(function() {
$("#iDate").datepicker({
    dateFormat: 'dd MM yy',
    beforeShowDay: unavailable
});

});
</script>

http://jsfiddle.net/JjPrU/178/

Answer 1:

.ui-datepicker td.ui-state-disabled>span{background:#c30;}
.ui-datepicker td.ui-state-disabled{opacity:100;}

http://jsfiddle.net/habo/JjPrU/179/



文章来源: Jquery Calendar Disabled Date colour