Repeater隔行换色、鼠标停留在上面是变色

来源:互联网 发布:深圳市软件产业基地4栋 编辑:程序博客网 时间:2024/05/21 14:08

 

<tr align="center" style='background-color: <%#(Container.ItemIndex%2==0)?"#FFFFF;":"#fcf3f4"%>'
 onmouseover="change_colorOver(this)" onmouseout="change_colorOut(this)">

</tr>

  <input type="hidden" id="colName" value="1" /> 

  function change_colorOver(e) {
            var oldColor = e.style.backgroundColor;
            document.getElementById("colName").value = oldColor;
            e.style.backgroundColor = "#b9bace";
        }
        function change_colorOut(e) {
            e.style.backgroundColor = document.getElementById("colName").value;
        }

原创粉丝点击