表格高亮显示

来源:互联网 发布:阿里云域名备案时间 编辑:程序博客网 时间:2024/05/02 01:27

<td   style="background-color:blue"   onmouseover="this.style.backgroundColor='red'"   onmouseout="this.style.backgroundColor='#FFFFFF'">   

VB 但原理一样:

Private Sub dgSupply_ItemDataBound(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgSupply.ItemDataBound
2        

4            '添加自定义属性,当鼠标移过来时设置该行的背景色为"6699ff",并保存原背景色
5            e.Item.Attributes.Add("onmouseover""StyleColor=javascript::this.style.backgroundColor;this.style.backgroundColor='#6699ff'")
6            '添加自定义属性,当鼠标移走时还原该行的背景色
7            e.Item.Attributes.Add("onmouseout""javascript::this.style.backgroundColor=StyleColor")
8        End If
9    End Sub

 

 


   

原创粉丝点击