repeater alternate lines of color and hover over them to change color

  • 2020-05-24 05:21:09
  • OfStack

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

 
<input type="hidden" id="colorName" value="1" /> // Hidden domain definition  
function change_colorOver(e) { 
var oldColor = e.style.backgroundColor; 
document.getElementById("colorName").value = oldColor; 
e.style.backgroundColor = "#b9bace"; 
} 
function change_colorOut(e) { 
e.style.backgroundColor = document.getElementById("colorName").value; 
} 

Related articles: