曾军的博客
记录我互联网产品的全新旅程
当前位置: 主页 > 代码收藏 >
29
2006-04
轮换显示的图片广告 代码
作者:admin | 浏览:
  1. <html> 
  2. <head> 
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
  4. <title>Untitled Document</title> 
  5. <style type="text/css"> 
  6. <!--  
  7. body {  
  8.   margin-left: 0px;  
  9.   margin-top: 0px;  
  10.   margin-right: 0px;  
  11.   margin-bottom: 0px;  
  12. }  
  13. --> 
  14. </style></head> 
  15.  
  16. <body topmargin="3"> 
  17. <table width="500" height="3" border="0" cellpadding="0" cellspacing="0"> 
  18.   <tr> 
  19.     <td><img src="images/ad/blank.gif" width="1" height="1"></td> 
  20.   </tr> 
  21. </table> 
  22. <!--rotate 硅呈 抛捞喉 矫累-->      
  23. <script> 
  24. var fadeimages = new Array;  
  25. var linkarr = new Array;  
  26. var numimg = new Array;  
  27.   fadeimages[0] = 'images/ad/ad060418.jpg';  
  28.   linkarr[0] = 'http://ttt.sdo.com/web1.0/News.asp?a=1&CategoryID=1&ID=136';  
  29.   numimg[0] = 'images/01_02.gif';  
  30.     
  31.   fadeimages[1] = 'images/ad/ad060424.jpg';  
  32.   linkarr[1] = 'http://itv.5qzone.net/ttqq/ttqq.htm';  
  33.   numimg[1] = 'images/02_02.gif';  
  34.     
  35.   fadeimages[2] = 'images/ad/ad01.gif';  
  36.   linkarr[2] = 'http://ttt.sdo.com/project/media/index.htm';  
  37.   numimg[2] = 'images/03_02.gif';  
  38.     
  39.   fadeimages[3] = 'images/ad/ad02.gif';  
  40.   linkarr[3] = 'http://ttt.sdo.com/project/test/event4.asp';  
  41.   numimg[3] = 'images/04_02.gif';  
  42.     
  43.   fadeimages[4] = 'images/ad/ad03.gif';  
  44.   linkarr[4] = 'http://ttt.sdo.com/project/test/event4.asp';  
  45.   numimg[4] = 'images/05_02.gif';  
  46.  
  47.     
  48. var cliImg = '';  
  49. var cliImgSrc = '';  
  50. var n = -1;  
  51. //var n = Math.round(Math.random() * 10);  
  52. var interval = 5000;  
  53. var setTimeId = '';  
  54.  
  55. function rotateStop()  
  56. {  
  57.   clearTimeout(setTimeId);  
  58. }  
  59.  
  60. function rotateStart()  
  61. {  
  62.   rotate();  
  63. }  
  64.  
  65. function chki(ci, no)  
  66. {  
  67.   var pImg = document.all.RollImg;  
  68.   var pUrl = document.all.RollUrl;  
  69.  
  70.   if(cliImg == '') {  
  71.     cliImg = ci;  
  72.     cliImgSrc = ci.src;  
  73.     ci.src = numimg[no];  
  74.     n=no;  
  75.     pImg.src = fadeimages[no];  
  76.     pUrl.href = linkarr[no];      
  77.   } else if(cliImg != ci) {  
  78.     cliImg.src = cliImgSrc;  
  79.     cliImg = ci;  
  80.     cliImgSrc = ci.src;  
  81.     ci.src = numimg[no];  
  82.     n=no;  
  83.     pImg.src = fadeimages[no];  
  84.     pUrl.href = linkarr[no];      
  85.   }  
  86. }  
  87.  
  88. function rotate()  
  89. {  
  90.   n = (n >= 4) ? 0 : n+1;  
  91.   setimgurl();  
  92.   setTimeId=setTimeout("rotate()",interval);  
  93. }  
  94.  
  95. function setimgurl()  
  96. {  
  97.   var ci = eval('document.all.num_img'+n);  
  98.  
  99. //  document.all.RollImg.filters.blendTrans.apply();  
  100.   document.all.RollUrl.href=linkarr[n];  
  101.   document.all.RollImg.src=fadeimages[n];  
  102. //  document.all.RollImg.filters.blendTrans.play();  
  103.     
  104.   if(cliImg == '') {  
  105.     cliImg = ci;  
  106.     cliImgSrc = ci.src;  
  107.     ci.src = numimg[n];  
  108.   } else if(cliImg != ci) {  
  109.     cliImg.src = cliImgSrc;  
  110.     cliImg = ci;  
  111.     cliImgSrc = ci.src;  
  112.     ci.src = numimg[n];  
  113.   }  
  114. }  
  115.  
  116. //--> 
  117. </script> 
  118. <table width="500" height="170" border="0" cellpadding="0" cellspacing="0"> 
  119.   <tr>   
  120.     <td><a href="http://ttt.sdo.com/web1.0/News.asp?a=1&CategoryID=1&ID=136" name="RollUrl" target="_blank" onFocus="this.blur()" ><img src="images/ad/ad060418.jpg"  border="0" name="RollImg" style="filter:blendTrans(duration=2);"width="500" height="140"></a></td> 
  121.   </tr> 
  122.   <tr>   
  123.     <td height="33" align="right" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
  124.         <tr>   
  125.           <td><img src="images/ttt.gif" width="202" height="26"></td> 
  126.           <td align="right"><Table border="0" cellpadding="0" cellspacing="0"> 
  127.               <tr>   
  128.                 <td valign="bottom" style="padding-bottom:2px;"> </td> 
  129.                 <td style="padding-bottom:2px;"><img src="images/01_01.gif" name="num_img0" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 0);"></td> 
  130.                 <td style="padding-bottom:2px;"><img src="images/02_01.gif" name="num_img1" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 1);"></td> 
  131.                 <td style="padding-bottom:2px;"><img src="images/03_01.gif" name="num_img2" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 2);"></td> 
  132.                 <td style="padding-bottom:2px;"><img src="images/04_01.gif" name="num_img3" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 3);"></td> 
  133.                 <td style="padding-bottom:2px;"><img src="images/05_01.gif" name="num_img4" width="29" height="22" border="0" align="absmiddle" style="cursor:hand" onClick="chki(this, 4);"></td> 
  134.               </tr> 
  135.             </TABLE></td> 
  136.         </tr> 
  137.       </table> 
  138.         
  139.     </td> 
  140.   </tr> 
  141. </table> 
  142. <SCRIPT LANGUAGE="JavaScript"> 
  143. <!--  
  144. rotateStart();  
  145. //--> 
  146. </SCRIPT> 
  147. </body> 
  148. </html> 
Tags:代码 轮换 图片广告 
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片