我一直坚持这个问题。日期选择器在静态内容上运行良好。
但是通过 Ajax 加载内容时失败。
我努力了 :-
jQuery.noConflict();
jQuery(function($) {
$(document).ready(function(){
$( ".datepickerRange" ).datepicker({
dateFormat: 'dd-mm-yy',
prevText:'',
nextText:'',
minDate: 0,
maxDate: "+1M",
showOn: "button",
buttonImage: divadatepicker.image_url+"/calendar.jpeg",
buttonImageOnly: true
});
$( ".datepicker" ).datepicker({
dateFormat: 'dd-mm-yy',
prevText:'',
nextText:'',
showOn: "button",
buttonImage: divadatepicker.image_url+"/calendar.jpeg",
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
yearRange: "1960:2015"
});
});
$(document).live(function(){
$( ".datepickerRange" ).datepicker({
dateFormat: 'dd-mm-yy',
prevText:'',
nextText:'',
minDate: 0,
maxDate: "+1M",
showOn: "button",
buttonImage: divadatepicker.image_url+"/calendar.jpeg",
buttonImageOnly: true
});
$( ".datepicker" ).datepicker({
dateFormat: 'dd-mm-yy',
prevText:'',
nextText:'',
showOn: "button",
buttonImage: divadatepicker.image_url+"/calendar.jpeg",
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
yearRange: "1960:2015"
});
});
});
通过 ajax 加载内容后,它没有显示均匀的日历小图像。