美文网首页
自动播放当前时间

自动播放当前时间

作者: 溺水的睫毛 | 来源:发表于2018-01-31 15:27 被阅读0次

    <div class="swiper-container swiper1">

    <div class="swiper-wrapper">

    <div class="d1 swiper-slide"></div>

    <div class="d1 swiper-slide"></div>

    </div>

    </div>

    function time1() {

    var date = new Date();

    document.getElementsByClassName("d1")[0].innerHTML = date.toLocaleString();

    document.getElementsByClassName('d1')[1].innerHTML = date.toLocaleString();

    }

    //time();

    window.setInterval(time1, 1000);

    function time2() {

    var date = new Date();

    document.getElementsByClassName("d2")[0].innerHTML = date.toLocaleString();

              document.getElementsByClassName('d2')[1].innerHTML = date.toLocaleString();

              console.log(date)

    }

    //time();

    window.setInterval(time2, 1000);

    var swiper1 = new Swiper('.swiper1',{

    loop:true,

    autoplay:6000

    })

    // console.log(data);

    相关文章

      网友评论

          本文标题:自动播放当前时间

          本文链接:https://www.haomeiwen.com/subject/hpxlzxtx.html