setInterval(test,1000); var array=new Array(); var index=0; var array= new Array("/>
今天看啥
热点:

js setInterval实现图片自动切换特效代码


   







图片自动跳转

<script language="javascript">

setInterval(test,1000);  

var array=new Array();

 var index=0;

 var array= new Array("http://www.111cn.net/js_a/81/image/1.jpg","image/2.jpg","image/3.jpg","image/4.jpg","image/5.jpg","image/6.jpg","image/7.jpg","image/8.jpg","image/9.jpg","image/10.jpg");

 function test()

 {    var myimg=document.getElementById("imgs"); 

   if(index==array.length-1)

   {     index=0;     }else{      index++;      }  

   myimg.src=array[index];  

}

</script>





js setInterval实现图片自动切换特效代码 



	  
	   

www.bkjia.comtruehttp://www.bkjia.com/qttx/1264941.htmlTechArticlejs setInterval实现图片自动切换特效代码 图片自动跳转 script language="javascript">setInterval(test,1000); var array=new Array(); var index=0; var array= new Array(...

相关文章

帮客评论

视觉看点