您的位置:首页 > 编程语言 > ASP

Asp.net 高亮显示鼠标所在行

2008-09-26 17:09 337 查看
调用的JavaScript:

<script type="text/javascript">

/*高亮显示鼠标所在行*/

function mouseovertd2(o)

{

dff=o.style.backgroundColor;

o.style.backgroundColor="#EAEBF1";

}

function mouseouttd2(o)

{

o.style.backgroundColor=dff;

}

</script>

GridView中的DataBound事件代码:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

{

if (e.Row.RowType == DataControlRowType.DataRow)

{

e.Row.Attributes.Add("onmouseover", "mouseovertd2(this)");

e.Row.Attributes.Add("onmouseout", "mouseouttd2(this)");

e.Row.Attributes["style"] = "Cursor:hand";

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: