<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>
HTML与JavaScript轮播图实现
本文介绍了一个使用HTML和JavaScript实现的轮播图案例。该案例通过预加载图片并利用定时器切换不同图片,展示了基本的网页动态效果制作方法。同时,点击图片会打开新窗口链接到指定网址。
1万+

被折叠的 条评论
为什么被折叠?



