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>

 

posted @ 2010-05-07 22:52  NON-Fish  阅读(236)  评论(0编辑  收藏  举报