给GridView里的行加上鼠标滚动效果
2008-11-19 17:56
267 查看
protected void gv_Main_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes.Add("id", "tr_" + e.Row.RowIndex.ToString());
e.Row.Attributes.Add("onmouseover", "onmouse(/"" + "tr_" + e.Row.RowIndex.ToString() + "/")");
e.Row.Attributes.Add("onmouseout", "mouseout(/"" + "tr_" + e.Row.RowIndex.ToString() + "/")");
}
<script language="javascript" type="text/javascript">
var orgColor;
function onmouse(rowId)
{
var myRow = document.getElementById(rowId);
orgColor = myRow.style.backgroundColor;
myRow.style.backgroundColor= "Red";
myRow.align = "center";
}
function mouseout(rowId)
{
var myRow = document.getElementById(rowId);
myRow.style.backgroundColor= orgColor;
myRow.align = "left";
}
</script>
相关文章推荐
- Asp.net 2.0 GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)(示例代码下载)
- Asp.net 2.0 GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)(示例代码下载)
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- 鼠标下拉滚动置顶效果
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- js图片滚动,鼠标经过滚动停止效果
- GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)
- ASP.NET2005 gridview中点击某行的任意位置选中某行 交替效果 变换鼠标手势
- javascript跟随鼠标的文字带滚动效果
- div不显示滚动条但实现鼠标移上去可以上下滚动的效果
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- jQuery实现鼠标滚动图片延迟加载效果附源码下载
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- ASP.NET2.0下为GridView添加鼠标滑过(onmouseover、onmouseout)的行颜色高亮效果!
- 纯css,div隐藏滚动条,保留鼠标滚动效果。
- GridView的几个事件(如实现: 行的双击/单击/捕捉键盘按键/鼠标悬浮/移出效果)(示例代码下载)
- 兼容FF,JS不间断循环滚动,包含自滚动,左右自滚动,点击左右滚动,鼠标暂停效果
- 隐藏滚动条、保留鼠标滚动效果
- jQuery实现响应鼠标滚动的动感菜单效果
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]