7
如果没有默认的日期是考虑到日期选择器,打开时,它今天就好像是选择的亮点。是否有可能打开datepicker没有任何日期预选?
如果没有默认的日期是考虑到日期选择器,打开时,它今天就好像是选择的亮点。是否有可能打开datepicker没有任何日期预选?
您不能删除所选的defaultDate
,因为它总是会选择一些内容(如果您将其保留为空,它将在今天进行选择)。然而,功能明智的,它并没有真正有所作为,所以走一条路周围是刚刚从像这样的日期取消选择类:
$("#datepicker").datepicker({
beforeShow: function(input, inst) {
window.setTimeout(function(){
$(inst.dpDiv).find('.ui-state-highlight.ui-state-hover').removeClass('ui-state-highlight ui-state-hover')
},0)
},
});
谢谢,我修改您的代码以满足我的需要: 'beforeShow:function(input,inst){ $ def = $(“#”+ inst.id).datepicker(“option”,“defaultDate”);如果($ def == null){ window.setTimeout(function(){ $(inst.dpDiv).find('td.ui-datepicker-current-day')。removeClass('ui-datepicker-current ('ui-state-hover'); },0); } } ' – Strosino 2011-06-17 10:06:54
您的修改后的代码保存了我的脖子Strosino。向你低头。 =) – dimitarvp 2012-05-11 19:06:52