图片特效-仿 iPhone 图片查看器效果
——————————————————————
<script type="text/javascript">
var arr = ['1.jpg','2.gif'];
function next(){
var img = document.getElementById('the_img');
var src = img.src;
var findIt = false;
for(var i=0;i<arr.length;i++){
if(src.indexOf(arr[i]) > -1){
findIt = true;
}
if(findIt){
var j = i + 1;
if(j == arr.length)
j = 0;
img.src = arr[j];
break;
}
}
}
</script>
————————————————————————
<body style="text-align:center">
<h2>点击图片翻下一张</h2>
<img src="1.jpg" id="the_img" onclick="next()" width="250" height="200"/>
</body>
————————————————————————