【发布时间】:2013-05-07 08:50:02
【问题描述】:
我尝试操作 jquery 的日期选择器,因为我想要多选。 现在我想更改所选日期的样式,例如将文本设为绿色。 我不知道如何改变风格。有没有可能?
感谢您的帮助!
这是我的代码:
$(".testpicker").datepicker({
numberOfMonths: 2,
showButtonPanel: false,
onSelect: function(test,object){
console.log(object.id);
//#####My first tries######//:
$("#"+object.id).css('color','green');
$(this).css('background-color','white');
//###########//
if(~$.inArray(test,dates))
{
console.log(test)
}
else
{
dates.push(test);
}
console.log(dates);
console.log(object);
//prevents closing
$(this).data('datepicker').inline = true;
},
onClose: function() {
$(this).data('datepicker').inline = false;
}
});
【问题讨论】:
标签: jquery jquery-ui-datepicker onselect