鼠标滑过变色与隔行变色
隔行变色的CSS
<styletype="text/css">
tr{
background-color:expression((this.sectionRowIndex%2==0)?"#E1F1F1":"#c9ccc6");
}
</style>
鼠标滑过变色的JS代码
<scriptlanguage="javascript">
window.onload=functionshowtable(){
vartablename=document.getElementById("mytable");
varli=tablename.getElementsByTagName("tr");
for(vari=0;i<=li.length;i++){
li[i].style.backgroundColor="#FFB584";
li[i].onmouseover=function(){
this.style.backgroundColor="#FFFFFF";
}
li[i].onmouseout=function(){
this.style.backgroundColor="#c9ccc6"
}
}
}
</script>
分享到: