gridview 鼠标经过改变颜色
2010-09-13 16:46
411 查看
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onMouseOver", "SetNewColor(this);");
e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");
}
}
<script type="text/javascript">
var _oldColor;
function SetNewColor(source)
{
_oldColor=source.style.backgroundColor;
source.style.backgroundColor='#FFFF99';
}
function SetOldColor(source)
{
source.style.backgroundColor=_oldColor;
}
</script>
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onMouseOver", "SetNewColor(this);");
e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");
}
}
<script type="text/javascript">
var _oldColor;
function SetNewColor(source)
{
_oldColor=source.style.backgroundColor;
source.style.backgroundColor='#FFFF99';
}
function SetOldColor(source)
{
source.style.backgroundColor=_oldColor;
}
</script>
相关文章推荐
- gridview repeater DataList 鼠标经过改变背景颜色
- 鼠标经过GridView的行改变行颜色
- gridview鼠标经过某行改变样式、颜色并且单击弹出窗口
- GridView扩展鼠标经过改变行的颜色
- gridview repeater DataList 鼠标经过改变背景颜色
- repeater单双行颜色不同,gridview repeater DataList 鼠标经过改变背景颜色
- gridview repeater DataList 鼠标经过改变背景颜色
- gridview鼠标经过某行改变样式、颜色并且单击弹出窗口
- gridview鼠标经过改变行颜色(高亮)
- GridView鼠标经过时颜色改变
- repeater单双行颜色不同,gridview repeater DataList 鼠标经过改变背景颜色
- 鼠标经过GridView的行会改变行颜色,离开后恢复原来的颜色
- GRIDVIEW 鼠标经过改变背景颜色
- gridview中鼠标都改变颜色
- 鼠标停留在GridView某一行时 行的颜色改变
- 鼠标经过时,改变表格背景颜色
- .NET中动态生成的表格,当鼠标经过tr时改变tr当前颜色,当鼠标移开恢复原来的颜色
- CSS 鼠标经过时改变table所在行的颜色
- 扩展GridView控件(1) - 鼠标经过行时改变行的样式
- 鼠标经过导航菜单时颜色改变效果