<script language =javascript >
var curIndex=0;
//时间间隔 单位毫秒 1000毫秒=1秒
var timeInterval=3000;
var arr=new Array();
arr[0]="images/01.jpg";
arr[1]="images/02.jpg";
arr[2]="images/03.jpg";
arr[3]="images/04.jpg";
arr[4]="images/05.jpg";
arr[5]="images/06.jpg";
arr[6]="images/07.jpg";
setInterval(changeImg,timeInterval);
function changeImg()
{
var obj=document.getElementById("pic");
if (curIndex==arr.length-1)
{
curIndex=0;
}
else
{
curIndex+=1;
}
obj.src=arr[curIndex];
}
</script>
<img id=pic src ="images/01.jpg" border =0 />
var curIndex=0;
//时间间隔 单位毫秒 1000毫秒=1秒
var timeInterval=3000;
var arr=new Array();
arr[0]="images/01.jpg";
arr[1]="images/02.jpg";
arr[2]="images/03.jpg";
arr[3]="images/04.jpg";
arr[4]="images/05.jpg";
arr[5]="images/06.jpg";
arr[6]="images/07.jpg";
setInterval(changeImg,timeInterval);
function changeImg()
{
var obj=document.getElementById("pic");
if (curIndex==arr.length-1)
{
curIndex=0;
}
else
{
curIndex+=1;
}
obj.src=arr[curIndex];
}
</script>
<img id=pic src ="images/01.jpg" border =0 />