看到老外的blog,说asp.net 2.0下的gridview中,当用户在gridview中用鼠标从上到下扫描各行时,起到加亮显示每次移动过的行的一个效果,
用javascript写的,还算简单,记录之
  <asp:repeater >

然后是javascript实现CSS效果
function Repeater_selectRow(row, ProductId)
{
var hdn=document.Form1.hdnProductID;
hdn.value = ProductId;
if (lastRowSelected != row)
{
if (lastRowSelected != null)
{
lastRowSelected.style.backgroundColor = originalColor;
lastRowSelected.style.color = 'Black'
lastRowSelected.style.fontWeight = 'normal';
}
originalColor = row.style.backgroundColor
row.style.backgroundColor = 'BLACK'
row.style.color = 'White'
row.style.fontWeight = 'normal'
lastRowSelected = row;
}
}
function Repeater_mouseHover(row)
{
row.style.cursor = 'hand';
}

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2021-06-02
  • 2021-08-14
  • 2022-12-23
  • 2021-06-08
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案