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

  • 相关阅读:
    vi 批量加注释与替换
    linux常用快捷键
    kubectl常用命令
    软件管理方法
    zabbix3.2升级3.4报错Database error
    zabbix显示中文乱码
    主从复制延迟及原因
    Python-- 文件与操作系统
    层次聚类
    盲源分离
  • 原文地址:https://www.cnblogs.com/auto123-num/p/11446939.html
Copyright © 2011-2022 走看看