现在的位置: 首页 > 综合 > 正文

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

2012年12月17日 ⁄ 综合 ⁄ 共 309字 ⁄ 字号 评论关闭
代码

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>中加入如上代码,即可实现!
 

抱歉!评论已关闭.