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>
原文地址:https://www.cnblogs.com/greatverve/p/1727819.html