如何在点击“今日”按钮关闭datepicker ui日历(选择当前日期+关闭日历窗口)

时间:2016-08-03 08:08:18

标签: javascript jquery jquery-ui

1 个答案:

答案 0 :(得分:1)

试试这个:

$(".datepicker").datepicker({
    showOn: "button",
    showButtonPanel: true,
    buttonImage: buttonCalendar,
    buttonImageOnly: true,
    buttonText: ""
});

并在您拥有日历的页面中调用此js代码。

$.datepicker._gotoToday = function(id) { 
    $(id).datepicker('setDate', new Date()).datepicker('hide').blur(); 
};
相关问题