banner广告轮换显示代码

2005-6-18 admin 分享
banner广告轮换显示代码
下面的代码保存为banner.htm文件。
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=javascript1.2>
function reapply(){
setTimeout("slideit()",2000)
return true
}
window.onerror=reapply
</SCRIPT>

<SCRIPT language=javascript1.1>
<!--
//preload images
var image1=new Image()
image1.src="bananer1.gif"
var image2=new Image()
image2.src="bananer2.gif"
var image3=new Image()
image3.src="bananer3.gif"
var image4=new Image()
image4.src="bananer4.gif"
var image5=new Image()
image5.src="bananer5.gif"
//-->
</SCRIPT>

</HEAD>
<BODY bgColor=#ffffff onload=slideit() leftmargin="0" topmargin="0" marginwidth="0"

marginheight="0">

style="filter:revealTrans(Duration=2, Transition=23)" width=468 height=60>
<!下面第六行

的20为换图的时间间隔>
<script>
<!--
////change number of images below
var number_of_images=5
//change speed below (in seconds)
var speed=20
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
if (document.all)
slide.filters.item(0).Apply()
document.images.slide.src=eval("image"+step+".src")
if (document.all)
slide.filters.item(0).Play()
whichimage=step
if (step<number_of_images)
step++
else
step=1
if (document.all)
setTimeout("slideit()",speed*1000+3000)
else
setTimeout("slideit()",speed*1000)
}
function slidelink(){
popup = window.open(““, “newwin“);
if (whichimage==1)
popup.location.href="http://www.91591.net";
if (whichimage==2)
popup.location.href="http://www.91591.net";
if (whichimage==3)
popup.location.href="http://www.91591.net";
if (whichimage==4)
popup.location.href="http://www.91591.net";
else if (whichimage==5)
popup.location.href="http://www.91591.net";
}
</script>
</BODY></HTML>


在banner位置调用方法:
<IFRAME marginWidth=0 marginHeight=0 src="banner.htm" frameBorder=0 noResize width=468
scrolling=no height=60></IFRAME>



继续阅读