dreamweaver table and List of alternate color JS effect code

Source: Internet
Author: User
Tags dreamweaver

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.