当鼠标悬停时,我需要一个代码片段来突出显示表格行。如果它有jquery tablesorter插件,我无法添加这个功能。
发布于 2011-04-27 11:40:39
在不影响表排序的情况下,您可以在tablesorter/style.css中添加一些额外的zebra widget
table.tablesorter tr.even:hover td,
table.tablesorter tr.odd:hover td {
background-color: blue;
}发布于 2011-04-25 08:45:26
要突出显示表中的行,可以使用:
$(document).ready(function() {
$("table").tablesorter();
$('table tr').has(':not(th)').hover(
function(){
$(this).data('currColor',$(this).css('background-color'));
$(this).css('background-color','#cdd');
},
function(){
$(this).css('background-color',$(this).data('currColor'));
}
);
});发布于 2012-01-31 04:54:15
您可以尝试将jQuery.Colorize插件与tablesorter一起使用。它可以让你保留不同的颜色。http://jquerycolorize.blogspot.com/2012/01/how-to-use-tablesorter-plugin-with.html
顺便说一句,如果你使用asp.net mvc,一个更好的选择是使用MvcContrib网格。
https://stackoverflow.com/questions/5774182
复制相似问题