|
2009-07-26, 11:06 AM | #1 |
注册日期: 2003-10-22
帖子: 11,053
积分:6
精华:24
现金:14348金币
资产:29325305金币
|
发一个广告轮播代码!
可以自定义轮播的广告数和间隔时间 HTML 代码:
<script> var i=1; var j=10; //广告总数,至少两少 var myobj = setInterval("adchange()",5000); //这里调整你的轮换时间,默认5秒 function adchange() { var k=1; i=i+1; for (k;k<=j;k++ ) { if(k!=i) { document.getElementById("ad_"+k).style.display='none'; } else { document.getElementById("ad_"+i).style.display='block'; } } if(i==j) i=0; } </script> <div id="ad_1" style="display:block"><a href="http://www.1819.net/" target="_blank"><img src="http://www.1819.net/upload/20090724/1.gif" border="0"></a></div> <div id='ad_2' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/2.gif' border="0"></a></div> <div id='ad_3' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/3.gif' border="0"></a></div> <div id='ad_4' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/4.gif' border="0"></a></div> <div id='ad_5' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/5.gif' border="0"></a></div> <div id='ad_6' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/6.gif' border="0"></a></div> <div id='ad_7' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/7.gif' border="0"></a></div> <div id='ad_8' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/8.gif' border="0"></a></div> <div id='ad_9' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/9.gif' border="0"></a></div> <div id='ad_10' style='display:none'><a href="http://www.1819.net/" target="_blank"><img src='http://www.1819.net/upload/20090724/10.gif' border="0"></a></div> |
|