【发布时间】:2012-01-18 15:09:45
【问题描述】:
我使用的 GridView 包含许多具有相同值的行,因此我使用 [GridViewHelper 类][1] 对这些行进行了分组。现在我想修复荧光笔,因为当它进入第一行时,它会突出显示第一个单元格,如下面的快照所示:
但是如果它转到第二行,它不会突出显示第一个单元格,如下面的快照所示:
荧光笔的css代码是:
.grid .datatable .row:hover
{
background-color:#fffacd;
color:#000;
}
我还使用了以下 JQuery,它的作用与 CSS 相同:
<!-- This Jquery is for highlighting any table, gridview and whatever -->
<script type="text/javascript">
$(document).ready(function() {
$("tr").filter(function() {
return $('td', this).length && !$('table', this).length
}).css({ background: "ffffff" }).hover(
function() { $(this).css({ background: "#C1DAD7" }); },
function() { $(this).css({ background: "#ffffff" }); }
);
});
</script>
<!-- End -->
[1]: http://www.agrine
i.com/gridviewhelper/gridviewhelper_en.htm
【问题讨论】: