zoukankan      html  css  js  c++  java
  • 上下无缝滚动

     1 (function(){
     2          var swiperBox = document.querySelector(".photo-wrapper");
     3          if(swiperBox.querySelector(".photo-wrapper img") == null){
     4              return false;
     5          }
     6          var height = swiperBox.querySelector(".photo-wrapper img").clientHeight;
     7          swiperBox.innerHTML = swiperBox.innerHTML + swiperBox.innerHTML;
     8          var during = (parseInt(swiperBox.dataset.during) || 15) * 1000;
     9          var speed = height/during * 17;
    10          var distance = 0;
    11          var timer = setInterval(function(){
    12              distance = distance + speed;
    13              swiperBox.style.transform = "translate3d(0," + (-distance + "px") + ",0)";
    14              swiperBox.style.webkitTransform = "translate3d(0," + (-distance + "px") + ",0)";
    15 
    16              if(distance >= height){
    17                  swiperBox.style.transform = "translate3d(0,0,0)";
    18                  swiperBox.style.webkitTransform = "translate3d(0,0,0)";
    19                  distance = 0;
    20              }
    21          },17)
    22      })();
    1 <div class="photo-wrapper">
    2                                             <img src="../node/qnKgFA/res/icon2.png?time=1507878758" width="100%" />
    3                                     </div>
  • 相关阅读:
    字符串、列表(操作)
    数据类型
    第二周 第四部分
    第二周 第三部分
    第二周第二部分
    特征缩放和标准化 设置学习率大小 正则方程
    梯度下降 coursera.org
    监督学习和无监督学习
    手写数字问题
    pytorch基础
  • 原文地址:https://www.cnblogs.com/xiaolixiaoxiao/p/7682056.html
Copyright © 2011-2022 走看看