Repeater中实现“鼠标滑动行变色”的效果

代码
1 <tr style='background-color: <%#(Container.ItemIndex%2==0)?"#eeeeee":"#ffffff"%>'onmouseover="this.style.background='#ddeeff'" onmouseout="this.style.background='<%#(Container.ItemIndex%2==0)?"#eeeeee":"#ffffff"%>'">

 

 

最终效果:当鼠标移过数据表的记录行时,指针所指的行的背景色改变,以达到跟其他行区分的效果。
做法:在Repeater中的Itemtemplate下的<tr>中加入如上代码,即可实现!
 
posted @ 2011-01-20 21:08  陆宗轩  阅读(896)  评论(0编辑  收藏  举报