1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3. <head> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  5. <title>防腾讯网的JS图片切换代码 - www.webdm.cn</title> 
  6. <STYLE type=text/css> 
  7. body{margin: 0px;}  
  8. A {COLOR: #313131;font-size: 9pt; TEXT-DECORATION: none}  
  9. A:hover {COLOR: #d7000f; TEXT-DECORATION: underline}  
  10. </STYLE> 
  11. </head> 
  12. <body> 
  13. <table width="389" border="0" cellspacing="0" cellpadding="0" class="mt13"> 
  14.   <tr> 
  15.     <td height="339" background="http://www.webdm.cn/p_w_picpaths/20100104/focus_bg.jpg"><!--focus--> 
  16.         <style type="text/css"> 
  17. .dis{display:block}  
  18. .undis{display:none}  
  19. .npim{border:#000 1px solid;}  
  20. .npim1 img{border:#E5E5E5 3px solid}  
  21. .nptx3{padding-left:207px;}  
  22. .nptx3 div{width:21px; line-height:20px; text-align:center;  margin-left:3px; float:left;cursor:pointer;}  
  23. .npfd1{background:url("http://www.webdm.cn/p_w_picpaths/20100104/f_num_on.gif") no-repeat;}  
  24. .npfd1 a,.npfd1 a:hover{color:#fff;text-decoration:none;}/* www.codefans.net */  
  25. .npfd2{background:url("http://www.webdm.cn/p_w_picpaths/20100104/f_num.gif") no-repeat;}  
  26.             </style> 
  27.         <div style="width:376px; height:300px; filter:progid:DXImagetransform.Microsoft.GradientWipe(duration=5,gradientSize=0.5,motion=forward ); margin:6px auto 0" id="fc"> 
  28.           <!--周一--> 
  29.           <table width="376" border="0" align="center" cellpadding="0" cellspacing="0"> 
  30.             <tr> 
  31.               <td class="npim"><a href="/" target="_blank" ><img src="http://www.webdm.cn/p_w_picpaths/wall1.jpg" width="374" height="300" border="0" /></a></td> 
  32.             </tr> 
  33.           </table> 
  34.           <!--周二--> 
  35.           <table width="378" border="0" align="center" cellpadding="0" cellspacing="0" class="undis"> 
  36.             <tr> 
  37.               <td class="npim"><a href="/" target="_blank" ><img src="http://www.webdm.cn/p_w_picpaths/wall2.jpg" width="374" height="300" border="0" /></a></td> 
  38.             </tr> 
  39.           </table> 
  40.           <!--周三--> 
  41.           <table width="378" border="0" align="center" cellpadding="0" cellspacing="0"> 
  42.             <tr> 
  43.               <td class="npim"><a href="/" target="_blank"><img src="http://www.webdm.cn/p_w_picpaths/wall3.jpg" width="374" height="300" border="0" /></a></td> 
  44.             </tr> 
  45.           </table> 
  46.           <!--周四 --> 
  47.           <table width="378" border="0" align="center" cellpadding="0" cellspacing="0" class="undis"> 
  48.             <tr> 
  49.               <td class="npim"><a href="/" target="_blank" ><img src="http://www.webdm.cn/p_w_picpaths/wall4.jpg" width="374" height="300" border="0" /></a></td> 
  50.             </tr> 
  51.           </table> 
  52.           <!--周五--> 
  53.           <table width="378" border="0" align="center" cellpadding="0" cellspacing="0"> 
  54.             <tr> 
  55.               <td class="npim"><a href="/" target="_blank" ><img src="http://www.webdm.cn/p_w_picpaths/wall5.jpg" width="374" height="300" border="0" /></a></td> 
  56.             </tr> 
  57.           </table> 
  58.           <!--周六--> 
  59.           <table width="378" border="0" align="center" cellpadding="0" cellspacing="0" class="undis"> 
  60.             <tr> 
  61.               <td class="npim"><a href="/" target="_blank" ><img src="http://www.webdm.cn/p_w_picpaths/wall6.jpg" width="374" height="300" border="0" /></a></td> 
  62.             </tr> 
  63.           </table> 
  64.           <!--周日--> 
  65.           <table width="378" border="0" align="center" cellpadding="0" cellspacing="0" class="undis"> 
  66.             <tr> 
  67.               <td class="npim"><a href="/" target="_blank" ><img src="http://www.webdm.cn/p_w_picpaths/wall7.jpg" width="374" height="300" border="0" /></a></td> 
  68.             </tr> 
  69.           </table> 
  70.         </div> 
  71.       <table width="378" border="0" align="center" cellpadding="0" cellspacing="0"> 
  72.           <tr> 
  73.             <td height="3"></td> 
  74.           </tr> 
  75.           <tr> 
  76.             <td class="nptx3" id="num"><div class="npfd1" onmouseover="Mea(0);clearAuto();" onmouseout="setAuto()"><a href="http://www.webdm.cn" target="_blank">1</a></div> 
  77.                 <div class="npfd2" onmouseover="Mea(1);clearAuto();" onmouseout="setAuto()"><a href="/" target="_blank">2</a></div> 
  78.               <div class="npfd2" onmouseover="Mea(2);clearAuto();" onmouseout="setAuto()"><a href="/" target="_blank">3</a></div> 
  79.               <div class="npfd2" onmouseover="Mea(3);clearAuto();" onmouseout="setAuto()"><a href="/" target="_blank">4</a></div> 
  80.               <div class="npfd2" onmouseover="Mea(4);clearAuto();" onmouseout="setAuto()"><a href="/" target="_blank">5</a></div> 
  81.               <div class="npfd2" onmouseover="Mea(5);clearAuto();" onmouseout="setAuto()"><a href="/" target="_blank">6</a></div> 
  82.               <div class="npfd2" onmouseover="Mea(6);clearAuto();" onmouseout="setAuto()"><a href="/" target="_blank">7</a></div></td> 
  83.           </tr> 
  84.         </table> 
  85.       <script>   
  86. var n=0;  
  87. var showNum = document.getElementById("num");  
  88.  
  89. var fc = document.getElementById("fc");  
  90. var week = new Date().getDay();  
  91. if(week)  
  92. {weekweek=week-1;}  
  93. else  
  94. {  
  95.  week=6;  
  96. }  
  97. ;  
  98. function Mea(value){  
  99.     n=value;  
  100.     setBg(value);  
  101.     plays(value);  
  102.     }  
  103. function setBg(value){  
  104.     for(var i=0;i<7;i++)  
  105.            if(value==i){  
  106.                 showNum.getElementsByTagName("div")[i].className='npfd1';  
  107.                 }   
  108.             else{     
  109.                 showNum.getElementsByTagName("div")[i].className='npfd2';  
  110.                 }  
  111. }  
  112. function plays(value){  
  113.     with (fc){  
  114.         filters[0].Apply();  
  115.         for(i=0;i<7;i++)i==value?getElementsByTagName("table")[i].className="dis":getElementsByTagName("table")[i].className="undis";   
  116.         filters[0].play();        
  117.         }  
  118.       
  119. }  
  120. var first='';  
  121. var autoStart='';  
  122. function clearAuto(){clearInterval(autoStart);}  
  123. function setAuto(){  
  124.     clearInterval(first);  
  125.     autoStart=setInterval("auto(n)", 5000)  
  126. }  
  127. function auto(value){  
  128.     n++;  
  129.     if(n>6)n=0;  
  130.     Mea(n);  
  131. }   
  132. first=setInterval("setAuto()", 5000);  
  133. Mea(week);  
  134.   </script> 
  135.         <!--focus end--> 
  136.     </td> 
  137.   </tr> 
  138. </table> 
  139. </body> 
  140. </html> 
  141.  
  142. <br /> 
  143. <a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!