I have an app made in PhoneGap with JQuery & AngularJS. One of my pages has a table. I want a way to let the user touch-drag across the table, and have the row & column of the currently-touched cell light up.
The table has position: fixed so that the user can "drag" across the screen without moving the app window.
Here's how this looks for a desktop mouseover event (JSFIDDLE):
table {
position:fixed;
}
.highlight {
background: #7ea2c6;
color: #FFF;
}
$('td').mouseover(function(e) {
//Add hover colours on mouseover
console.log("Event Fired");
var index, selector, parent;
index = ($(this).index() + 1);
parent = ($(this).parent('tr'));
$(parent).addClass("highlight");
selector = "tbody td:nth-child(" + index + ")";
$(selector).addClass("highlight");
}).mouseout(function(e) {
$('tr, td, p').removeClass("highlight");
});
What's the best library & event behaviour to use to get this behaviour to work for touch?