3
有沒有辦法在刷卡時更改日期選擇器的月份?我的意思是任何方式來顯示下一個和上個月刷卡?Jquery Mobile Datepicker在刷卡上更改月份
這裏是我的方法:
jQuery Mobile的刷卡:
// Bind the swipeHandler callback function to the swipe event on div.box
$("#main-page").on("swipeleft", swipeLeftHandler).on("swiperight", swipeRightHandler);
function swipeLeftHandler(event){
// $(event.target).addClass("swipe");
console.log('swiped Left');
}
function swipeRightHandler(event){
// $(event.target).addClass("swipe");
console.log('swiped Right');
}
,這裏是jQuery Mobile的日期選擇器代碼:
$(".date-input-inline").datepicker({
onChangeMonthYear: function(year, month, inst) {
$(".ui-datepicker").fadeOut(0);
$(".ui-datepicker").fadeIn("normal");
},
dateFormat: 'yy-mm-dd',
yearRange: currentY + ':' + currentY,
});