我正在尝试使Date Range Picker
与this类似。
我已经尝试使用类似的东西
$('#calendar-dates').on('mouseover', 'td', function() {
if($(this).html() > window.start){
$(this).addClass("added");
}
});
$('#calendar-dates').on('click', 'td', function() {
window.start = $(this).html(); // get the number of the day
$(this).addClass("start"); // to mark it the date-selection start
});
我想要的是,如果我使用鼠标按钮将
horizontally
放在td
之后的this day
元素上,以使用background-color
突出显示它们要么
如果我去
vertically
更改上一行的background-color
。我已经阅读过有关
slice
的信息,但我想不起来如何正确地利用它。同样使用
mouseover
,在一点之后它将停止突出显示元素。请帮忙。
最佳答案
你可以试试看
$( "#calendar-dates" ).mouseover(function() {
// do something
}).click(function() {
// do something
});