//鼠标所在当前行背景色的改变
currentRow.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#90EE90'");
currentRow.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
//鼠标在单元格背景色的改变cell.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FFFF00'");
cell.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
本文介绍如何使用JavaScript实现鼠标悬停时改变表格中当前行和单元格的背景颜色,通过设置onmouseover和onmouseout事件属性来实现场景交互效果。
1253

被折叠的 条评论
为什么被折叠?



