thesocialgeek , CSS JS.
, JS script . rowspan.
CSS:
tr.hover,
th.hover,
td.hover,
tr.hoverable:hover {
background-color: grey;
}
CSS ':hover. , <th> <td> .hover. .
JS :
$(document).ready(function() {
$('tr.hoverable [rowspan]').each(function(index, cell) {
var $cell = $(cell);
var rowspan = $cell.attr('rowspan');
var limit = rowspan - 1;
var $this_row = $cell.closest('tr');
var $next_rows = $this_row.nextAll('tr:lt(' + limit + ')');
$next_rows.hover(
function() {$cell. addClass('hover')},
function() {$cell.removeClass('hover')}
);
});
});
mouseenter mouseleave , rowspan. , , CSS.
: . . , , .
I tested the code only in Firefox 22 using jQuery 2.0.3, where the result is completely as expected.
Update: I found it useful and expanded the code to highlight all the lines associated with the cell rowspanwhen that cell freezes. Add the following snippet to the long function above:
$cell.hover(
function() {$next_rows. addClass('hover')},
function() {$next_rows.removeClass('hover')}
);
source
share