1
// JavaScript Document
var p_w_picpathNames=["p_w_picpaths/b1.gif","p_w_picpaths/b2.gif","p_w_picpaths/b3.gif","p_w_picpaths/b4.gif"];
var curImage=0;
function changeImage(){
var imgObj=document.getElementById("banderImage");
imgObj.src=p_w_picpathNames[curImage++];
if(curImage>3){
curImage=0;
}
window.setTimeout("changeImage()",3000);
}
function autoImage(){
window.setTimeout("changeImage()",3000);
}
var p_w_picpathNames=["p_w_picpaths/b1.gif","p_w_picpaths/b2.gif","p_w_picpaths/b3.gif","p_w_picpaths/b4.gif"];
var curImage=0;
function changeImage(){
var imgObj=document.getElementById("banderImage");
imgObj.src=p_w_picpathNames[curImage++];
if(curImage>3){
curImage=0;
}
window.setTimeout("changeImage()",3000);
}
function autoImage(){
window.setTimeout("changeImage()",3000);
}
2
<body οnlοad="changeImage()">
<div id="bkg">
<div id="bander"><img id="banderImage" src="p_w_picpaths/b4.gif" width="688" height="190" /></div>
<body οnlοad="changeImage()">
<div id="bkg">
<div id="bander"><img id="banderImage" src="p_w_picpaths/b4.gif" width="688" height="190" /></div>
转载于:https://blog.51cto.com/myapple123/363473