简体   繁体   中英

table row hover highlighting with Tablesorter / jquery?

I'm using the jquery Tablesorter with the zebra widget for my table.

I want to be able to hover each row and change the background for the highlight. Is this possible? Anyone with ideas?

thanks.

Erik

var $rows = $('table tbody tr');
$rows.hover(function () {
    $(this).addClass("rowHover");
}, function() {
    $(this).removeClass("rowHover");
});

Then create the stylesheet rule for zebra rows being hovered:

.even.rowHover,
.odd.rowHover {
    background-color: #F0F0F0;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM