I have a fairly large table grouped by the data attribute, which looks like this:
<table> <tr data-group="666"><td></td></tr> <tr data-group="666"><td></td></tr> <tr data-group="2"><td></td></tr> <tr data-group="2"><td></td></tr> <tr data-group="XXXX"><td></td></tr> <tr data-group="XXXX"><td></td></tr> </table>
I do not know the meaning of possible groups in advance (there may be more than 50 groups). They are generated dynamically.
Right now I'm using jQuery to create a cursor highlight effect, but a bit slow. I was wondering if there is a way to do this using CSS.
Here is what I am using now:
$('tr').live('hover', function() { $('tr[data-group="'+$(this).data('group')+ '"]').toggleClass('hover'); });
Working demo: http://jsfiddle.net/MW69S/
source share