<div class="pic2" style="height: 275px;padding-left: 12px;">
<img src="Img/a.png" id="showpic" />
</div>
<script language=javascript>
var curIndex = 0;
//时间间隔 单位毫秒
var timeInterval = 3000;
var arr = new Array();
arr[0] = "a.png";
arr[1] = "aa.jpg";
arr[2] = "aaa.jpg";
arr[3] = "aaaa.jpg";
arr[4] = "aaaaa.jpg";
setInterval(changeImg, timeInterval);
function changeImg() {
var obj = document.getElementById("showpic");
if (curIndex == arr.length - 1) {
curIndex = 0;
} else {
curIndex += 1;
}
obj.src = "Img/" + arr[curIndex];
}
</script>