dreamweaver table and list alternate color JS effect
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Forms Alternate Colors </title>
<style type= "text/css" media= "screen" >
<!--/* pr-<a class= "Channel_keylink" href= "http://webdesign.chinaitlab.com/List_1367.html" target= "_blank" >CSS</a> *
Table {border-collapse:collapse;border:solid #999; border-width:1px 0 0 1px;}
Table td {Border:solid #999; border-width:0 1px 1px 0;}
. T1 {background-color: #fff;} /* The background color of the first line * *
. t2 {background-color: #eee;} /* The background color of the second line * *
. t3 {background-color: #ccc;} /* The background color when the mouse passes by * *
-->
</style>
<body>
<ul><li>11111111</li>
<li>222222222</li>
<li>3333333</li>
<li>444444444</li>
</ul>
<script type= "Text/javascript" >
<!--
var ptr=document.getelementsbytagname ("Li");
function $ () {
for (i=1;i<ptr.length+1;i++) {
Ptr[i-1].classname = (i%2>0)? " T1 ":" T2 ";
}
}
window.onload=$;
for (Var i=0;i<ptr.length;i++) {
Ptr[i].onmouseover=function () {
This.tmpclass=this.classname;
This.classname = "T3";
};
Ptr[i].onmouseout=function () {
This.classname=this.tmpclass;
};
}
-->
</script>
</body>