BANNER广告轮换显示代码
类别: JavaScript教程
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">
<a href="javascript:slidelink()"><img src="bananer1.gif" name="slide" border=0
style="filter:revealTrans(Duration=2, Transition=23)" width=468 height=60></a><!下面第六行
的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>
</body>
</html>
下面的代码保存为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">
<a href="javascript:slidelink()"><img src="bananer1.gif" name="slide" border=0
style="filter:revealTrans(Duration=2, Transition=23)" width=468 height=60></a><!下面第六行
的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>
</body>
</html>
- 上一篇: 弹出网页窗口全攻略(HTML/HTA)
- 下一篇: 浮动对联广告效果的代码
-= 资 源 教 程 =-
文 章 搜 索