Jquery 日期选择器:从不显示日期选择 "ui-datepicker-calendar"
Jquery Datepicker : Never show the day selection "ui-datepicker-calendar"
我需要一个日期选择器从不显示日期部分。
我想因此destroy/remove这个元素:"ui-datepicker-calendar"
绝不能显示。我只想使用日期和年份选择。
看来最好的地方是看"beforeShow"
$("#datepicker").datepicker({ dateFormat: 'dd/mm/yy', beforeShow: myFunction});
function myFunction(input,inst)
{
alert(inst);
$(".ui-datepicker-calendar").remove();
//$(".ui-datepicker-calendar").destroy(); //this causes infinite loop
}
这可能吗?
http://jsfiddle.net/UEnqL/9/
我已经试过了"destroy","hide"它只会在下次点击时返回。
$("#datepicker").focus(function(){
$(".ui-datepicker-calendar").remove()
})
使用上面的代码删除 "ui-datepicker-calendar" 部分。
我需要一个日期选择器从不显示日期部分。
我想因此destroy/remove这个元素:"ui-datepicker-calendar"
绝不能显示。我只想使用日期和年份选择。
看来最好的地方是看"beforeShow"
$("#datepicker").datepicker({ dateFormat: 'dd/mm/yy', beforeShow: myFunction});
function myFunction(input,inst)
{
alert(inst);
$(".ui-datepicker-calendar").remove();
//$(".ui-datepicker-calendar").destroy(); //this causes infinite loop
}
这可能吗? http://jsfiddle.net/UEnqL/9/
我已经试过了"destroy","hide"它只会在下次点击时返回。
$("#datepicker").focus(function(){
$(".ui-datepicker-calendar").remove()
})
使用上面的代码删除 "ui-datepicker-calendar" 部分。