读书人

Repeater鼠标透过变色

发布时间: 2012-11-23 22:54:33 作者: rapoo

Repeater鼠标经过变色

<script type="text/javascript">
? ? function fOver(obj){
? ? ? ? c=obj.style.backgroundColor;
? ? ? ? obj.style.backgroundColor="#CAD3E4";
? ? }
? ? function fOut(obj){
? ? ? ? obj.style.backgroundColor=c;
? ? }
</script>

<table>
? ? <tr>
? ? ? ? <td>用户编号</td>
? ? </tr>
? ? <asp:Repeater ID="rptUser" runat="server">
? ? <ItemTemplate>
? ? <tr style='background-color:<%#(Container.ItemIndex%2==0)?"red":"green"%>' onmouseover="fOver(this);" onmouseout="fOut(this);">
? ? ? ? <td><%#Eval("UID")%></td>
? ? </tr>
? ? </ItemTemplate>
? ? </asp:Repeater>
</table>

读书人网 >Web前端

热点推荐