zoukankan      html  css  js  c++  java
  • 大屏某区域滚动效果循环

    // 数据自动滚动事件BEGIN

    var botTimer = null;  // 定时器对象

    $('.tbody').hover(function () {
    clearInterval(botTimer); // hover
    }, function () {
    scrollCore('tbodyScroll', 'tbody'); //out
    }); //
    function scrollCore(outerId, innerId) {
    var winHei = $("#" + outerId).height();
    var listHei = $("#" + innerId).height();
    var top = document.getElementById(innerId).style.marginTop.replace('px', '') ? document.getElementById(innerId).style.marginTop.replace('px', '') : 0;
    botTimer = setInterval(function () {
    if (Math.abs(top) >= (listHei - winHei)) {
    //请求最新数据
    //listHei = loadNewData(innerId);
    if (Math.abs(top) >= (listHei - winHei)) {
    // 如果没有再多数据,就清空定时器
    clearInterval(botTimer);
    document.getElementById(innerId).style.marginTop = 0;
    // 再次调函数
    scrollCore(outerId, innerId);
    } else {
    top -= 1; 
    document.getElementById(innerId).style.marginTop = top + 'px';//px
    }
    } else {
    top -= 1;
    document.getElementById(innerId).style.marginTop = top + 'px';//px
    }
    }, 200);
    }
    // END

  • 相关阅读:
    HTTP——Web服务器、代理、缓存
    nginx配置文件详解2
    nginx配置文件详解
    shell笔记2
    django笔记
    python 发请求,urllib,urllib2
    nginx配置
    python os模块学习
    mac 终端命令小结
    mac常用命令笔记
  • 原文地址:https://www.cnblogs.com/auto123-num/p/11446939.html
Copyright © 2011-2022 走看看