Skip to content

Instantly share code, notes, and snippets.

@stugoo
Created August 22, 2013 11:55
Show Gist options
  • Save stugoo/6306256 to your computer and use it in GitHub Desktop.
Save stugoo/6306256 to your computer and use it in GitHub Desktop.
highlighting a table cell and all others behind it until the first item.
calendarTo.on('mouseover', 'td', function(){
var tds = calendarTo.find('td').not('.ui-datepicker-other-month');
fromTd = tds.filter('.ui-state-range:first');
thisTd = $(this);
startIndex = tds.index(fromTd);
endIndex = tds.index(thisTd)+1;
if(startIndex < 0) startIndex = 0;
tds.slice(startIndex, endIndex).addClass(hoverClass);
}).on('mouseout',function(){
$('#date-to-container .'+hoverClass).removeClass(hoverClass);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment