<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>轮播图</title>
</head>
<body>
<img src="img/1.jpg" id="myShow"/>
<script>
var oShow=document.getElementById('myShow');
window.οnlοad=function()
{ setInterval('show()',1000); }
var nums=1;
function show()
{
oShow.src="img/"+nums+".jpg";
nums++;
if(nums>4)
nums=1;
}
</script>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>轮播图</title>
</head>
<body>
<img src="img/1.jpg" id="myShow"/>
<script>
var oShow=document.getElementById('myShow');
window.οnlοad=function()
{ setInterval('show()',1000); }
var nums=1;
function show()
{
oShow.src="img/"+nums+".jpg";
nums++;
if(nums>4)
nums=1;
}
</script>
</body>
</html>