轮播图
1.jpg
2.jpg
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>轮播图</title>
<script>
var number =1;
function fun(){
number ++;
if(number>2){
number=1;
}
var img =document.getElementById("img");
img.src = number+".jpg";
}
setInterval(fun,3000);
</script>
</head>
<body>
<img id="img" src="1.jpg" width="90%">
</body>
</html>