<html>
<head>
<title>图片翻页</title>
</head>
<body>
<a href="#" οnclick="p(-1)">上一张</a>
<a href="" target="_blank"><img title="0" src="999_001.JPG" id="img" /></a>
<a href="#" οnclick="p(+1)">下一张</a>
<script>
function p(n){
var img = document.getElementById('img');
var n = Number(img.title) + n;
if(n < 0) n = 5;
if(n > 5) n = 1;
img.src = '999_00'+n+'.JPG';
img.title = n;
var a = img.parentNode;
a.href = img.src;
return false;
}
//setInterval(function(){p(+1)},2998);
</script>
</body>
</html>
<head>
<title>图片翻页</title>
</head>
<body>
<a href="#" οnclick="p(-1)">上一张</a>
<a href="" target="_blank"><img title="0" src="999_001.JPG" id="img" /></a>
<a href="#" οnclick="p(+1)">下一张</a>
<script>
function p(n){
var img = document.getElementById('img');
var n = Number(img.title) + n;
if(n < 0) n = 5;
if(n > 5) n = 1;
img.src = '999_00'+n+'.JPG';
img.title = n;
var a = img.parentNode;
a.href = img.src;
return false;
}
//setInterval(function(){p(+1)},2998);
</script>
</body>
</html>