我想创建一个范围滑动器, 该滑动器运行于下拉菜单 {每日, 每周和每月} 。
On selection of daily steps are changed to 7 and minDate chages to maxDate means todays date-7. On selection of weekly steps are changed to 4(7-7-7-7=30) and minDate chages to (maxDate)today date-30. on selection of monthly steps are changed to 12(12 months=365 days) and minDate chages to (maxDate)today date-365.
鼠标指针指向最大
var maxdate1 = new Date(),
minDate1 = removeDays(new Date(), -7);
alert(minDate1);
$( "#slider" )
.slider({range: true,
step: 1,
animate:true,
value: maxDate1,
values [minDate1, maxDate1],
max: Math.floor((maxDate1.getTime() - minDate1.getTime()) / 86400000),
slide: function(event, ui) {
var date = new Date(minDate1.getTime());
date.setDate(date.getDate() + ui.values[0]);
$( #startDate ).val($.datepicker.formatDate( mm/dd/yy , date));
$( #from ).val($.datepicker.formatDate( M d, yy , date));
date = new Date(minDate1.getTime());
date.setDate(date.getDate() + ui.values[1]);
$( #endDate ).val($.datepicker.formatDate( mm/dd/yy , date));
$( #to ).val($.datepicker.formatDate( M d, yy , date));
}
});