?? 23.html
字號:
<html>
<head>
<title>banner的翻轉效果</title>
</head>
<body onLoad="initiate()">
<span id="imgcontainer1" style="position: absolute; left: 22; top: -65; width: 468; height: 19; z-index: 1"></span>
<span id="imgcontainer2" style="position: absolute; left: 22; top: -37; width: 469; height: 25; z-index: 2"></span>
<script>
var imgwidth=468
var imgheight=60
var pos_left=22
var pos_top=50
var imgname=new Array()
imgname[0]="08.gif" //設置圖片1
imgname[1]="09.gif" //設置圖片2
var imgurl=new Array()
imgurl[0]="http://vs.com.cn" //設置鏈接地址
imgurl[1]="http://vs.com.cn" //設置鏈接地址
var imgpreload=new Array()
for (i=0;i<=imgname.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=imgname[i]
}
var pause=2000
var speed=10
var step=9
var i_loop=0
var i_image1=0
var i_image2=1
function stretchimage() {
if (i_loop<=imgwidth) {
if (document.all) {
imgcontainer1.innerHTML="<a href='"+imgurl[i_image1]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+imgname[i_image1]+"' border='0'></a>"
document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft+i_loop
imgcontainer2.innerHTML="<a href='"+imgurl[i_image2]+"' target='_blank'><img width='"+(imgwidth-i_loop)+"' height='"+imgheight+"' src='"+imgname[i_image2]+"' border='0'></a>"
}
i_loop=i_loop+step
var timer=setTimeout("stretchimage()",speed)
}
else {
clearTimeout(timer)
changeimage()
}
}
function changeimage() {
i_loop=0
i_image1++
if (i_image1>imgname.length-1) {i_image1=0}
i_image2=i_image1-1
if (i_image2>imgname.length-1) {i_image2=0}
if (i_image2<0) {i_image2=imgname.length-1}
document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft
var timer=setTimeout("stretchimage()",pause)
}
function initiate() {
if (document.all) {
document.all.imgcontainer1.style.posLeft=pos_left
document.all.imgcontainer2.style.posLeft=pos_left
document.all.imgcontainer1.style.posTop=pos_top
document.all.imgcontainer2.style.posTop=pos_top
changeimage()
}
if (document.layers) {
document.imgcontainer1.left=pos_left
document.imgcontainer2.left=pos_left
document.imgcontainer1.top=pos_top
document.imgcontainer2.top=pos_top
rotatenetscape()
}
}
function rotatenetscape() {
document.imgcontainer1.document.write("<a href='"+imgurl[i_image1]+"' target='_blank'><img src='"+imgname[i_image1]+"' border='0'></a>")
document.imgcontainer1.document.close()
i_image1++
if (i_image1>imgname.length-1) {i_image1=0}
var timer=setTimeout("rotatenetscape()",pause*2)
}
// - End -->
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -