会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
.NET开发培训
Tim工作室----教育改变生活
博客园
首页
新随笔
联系
管理
订阅
用样式实现DataGrid数据行颜色改变
<
asp:DataGrid
id
="DataGrid1"
runat
="server"
CssClass
="small"
></
asp:DataGrid
>
样式
.small
{
}
{
font-size
:
9pt
;
weaver
:
expression(highlight(this))
}
JavaScript
<
script language
=
"
javascript
"
>
function
highlight(obj)
{
var
hightlightBgColor
=
'#d6d6d6';
obj.onmouseover
=
function
()
{
var
o
=
event.srcElement;
if
(o.tagName
==
"
TD
"
)
{
with
(o.parentElement)
{
style.backgroundColor
=
hightlightBgColor;
}
}
}
obj.onmouseout
=
function
()
{
var
o
=
event.srcElement;
if
(o.tagName
==
"
TD
"
)
{o.parentElement.style.backgroundColor
=
'';}
}
}
</
script
>
posted @
2006-05-29 18:14
Tim工作室
阅读(
325
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告