为什么第二次就不能翻转图片了呢?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript" src="train.js"></script> </head> <body>
<div>
<img id="adBanner" src="01.jpg" width="307" height="203" alt="" />
</div>
</body>
</html>
-----------------------------------------------------------------------------------------------------------
//jsvar adImages = new Array("01.jpg","02.jpg","03.jpg");
var thisAd = 0;
function rotate(){
document.getElementById("adBanner").src = adImages[thisAd];
thisAd++;
setTimeout("rotate()", 3000);
}
window.onload = rotate;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript" src="train.js"></script> </head> <body>
<div>
<img id="adBanner" src="01.jpg" width="307" height="203" alt="" />
</div>
</body>
</html>
-----------------------------------------------------------------------------------------------------------
//jsvar adImages = new Array("01.jpg","02.jpg","03.jpg");
var thisAd = 0;
function rotate(){
document.getElementById("adBanner").src = adImages[thisAd];
thisAd++;
setTimeout("rotate()", 3000);
}
window.onload = rotate;
var adImages = new Array("01.jpg","02.jpg","03.jpg");
var thisAd = 0;
function rotate(){
if(thisAd > adImages.length){
thisAd=0;
}
else{
thisAd++;
}
document.getElementById("adBanner").src = adImages[thisAd];
setTimeout("rotate()", 3000);
}
window.onload = rotate;