Slidowshow 滚动条

<html>
<head>
<title>SlideShow</title>
<script language="JavaScript1.1">
<!--
var yourImages = new Array("http://blog.donews.com/images/blog_donews_com/dodo/79382/o_5540320040330075952.jpg","http://www.iqoo.com/tupian/%D0%C7%D7%F9%B1%DA%D6%BD/iqoo_1113__aries.jpg","http://blog.donews.com/images/blog_donews_com/dodo/79382/o_5540320040330081327.jpg","http://blog.donews.com/images/blog_donews_com/dodo/79382/o_5540320040330081426.jpg")

var currCount=0
var stop=false

function getimg(n){
preImages= new Image()
preImages.src = yourImages[n]
}


function autoPlay(){
if(currCount!=yourImages.length){
document.getElementById("img").style.display="none"
getimg(currCount)
document.getElementById("loadingbar").style.display="block"
setTimeout("loadingImg()",1000)
}
else{
currCount=0;
if (confirm("播放完毕,是否重新播放?")){
return autoPlay()
}
}
}

function loadingImg(){

if (preImages.complete) {
  document.getElementById("img").src="http://blog.donews.com/images/blog_donews_com/dodo/49134/o_pix.gif"
  document.getElementById("loadingbar").style.display="none"
 
  document.getElementById("img").style.display="block"
 
  document.getElementById("img").src=yourImages[currCount]
  currCount=currCount+1
  }
setTimeout("autoPlay()",4000)
}

//-->
</script>

</head>

<body bgcolor="#FFFFFF">
<div style="width:700px">
<center>
<a href="javascript:autoPlay()">自动播放</a><br><br>
<div id="loadingbar"  style="display:none;"><img src=http://blog.donews.com/images/blog_donews_com/dodo/49134/o_loading.gif></div>
<img id="img" src=http://blog.donews.com/images/blog_donews_com/dodo/49134/o_pix.gif >

<center>
</div>

</body>
</html>

你可能感兴趣的:(Blog)