zoukankan      html  css  js  c++  java
  • 自动轮播精简版

    <script>
    var banners = ['index4.jpg', 'index2.jpg','index1.jpg'];
    var idx = 0;
    setInterval(function(){
    if(idx < banners.length){
    document.querySelector('.container-lb').style.background = 'url(img/' + banners[idx] + ')';
    }else{
    idx = 0;
    document.querySelector('.container-lb').style.background = 'url(img/' + banners[idx] + ')';
    }
    idx++;
    }, 4000);
    </script>

  • 相关阅读:
    11.29
    11.28
    11.24
    11.21
    11.17
    11.15
    11.14
    11.9
    11.5
    11.3
  • 原文地址:https://www.cnblogs.com/TTTK/p/6253056.html
Copyright © 2011-2022 走看看