【发布时间】:2017-01-25 14:31:40
【问题描述】:
我尝试在我的 jQuery-Mobile 项目中实现 DatePicker。以下是来源:http://demos.jquerymobile.com/1.4.1/datepicker/
不幸的是,它默认不支持通过滑动事件更改月份。我确实得到了这个question,它(可能)和我有同样的情况,但不知何故它不适用于我的情况。
这是我尝试过的:
$('#ui-datepicker-div').on("swipeleft", function () {
console.log("left");
var thedate = $("#ui-datepicker-div").date('getDate'); //get date from datepicker ( I can't get anything from here)
//thedate.setMonth(thedate.getMonth() + 1); //add a month
//$(this).datepicker('setDate', thedate); // set the date in datepicker
});
有人知道吗?
【问题讨论】:
标签: javascript jquery jquery-mobile datepicker jquery-ui-datepicker