标签:get html span 轮播 func highlight 图片轮播 logs 图片
<div id="wai"> <div id="wai_a1"> <img class="img" src="../图片/张掖丹霞7.jpeg" width="640px" height="400px" /> <img class="img" src="../图片/丹霞1.jpg" width="640px" height="400px" /> <img class="img" src="../图片/丹霞4.jpg" width="640px" height="400px" /> </div> <div id="wai_a2"> <div class="wai_a2_a"> <img src="../图片/张掖丹霞3.jpeg" width="360px" height="200px"/> </div> <div class="wai_a2_a"> <img src="../图片/丹霞3.jpg" width="360px" height="200px" /> </div> </div> </div>
var index=0; var img=document.getElementsByClassName("img"); huan(); function huan(){ //xianshi(); for(var i=0;i<img.length;i++){ img[i].style.display="none"; } img[index].style.display="block"; if(index>=img.length-1){ index=0; } else{ index++; } window.setTimeout("huan()",2000); } /*function xianshi(){ for(var i=0;i<img.length;i++){ img[i].style.display="none"; } img[index].style.display="block"; }*/
标签:get html span 轮播 func highlight 图片轮播 logs 图片
原文地址:http://www.cnblogs.com/jgjk/p/7106902.html