blog
blog copied to clipboard
timePicker 使用范例
调用范例
var booksInfo=[];
var picker=$.timePicker({
selected:curSelected,
changeDay:function(day){
var info=booksInfo[day]||['15:00','17:00','21:00'];
if(info){
mockBooksInfo(info);
}else{
getBooksInfo(day);
}
function mockBooksInfo(info){
$.each(info,function(i,n){
$('.pick-time[data-value="'+n+'"]').addClass('booked').append('<span class="booked-txt">预约</span>');
});
}
}
},function(){
curSelected=picker.getDay()+' '+picker.getTime();
console.log(curSelected)
});
效果图:

