zoukankan      html  css  js  c++  java
  • 兼容IE8,滚动加载下一页

    // 滚动加载下一页
            var nowScrolledHeight = document.documentElement.scrollTop || document.body.scrollTop;
            var docHeight = document.body.clientHeight;
            if(window.innerHeight!= undefined){
                var pageHeight = window.innerHeight;
            } else{
                var B= document.body, D= document.documentElement;
                var pageHeight = Math.min(D.clientHeight, B.clientHeight);
            }
            var go = parseInt(docHeight) - parseInt(pageHeight + 20);
            console.log(nowScrolledHeight)
            console.log(docHeight)
            console.log(pageHeight)
            console.log(go)
            if (nowScrolledHeight >= go && hasNext) {
                console.log('滚动成功');
                pageIndex++;
                searchGoods(word, pageIndex, orderType);
                $(".data_loading").show();
                $(".data_lastpage").hide();
            } else if(!hasNext){
                $(".data_loading").hide();
                $(".data_lastpage").show();
            }
  • 相关阅读:
    【leetcode】Validate Binary Search Tree
    【leetcode】Add Binary
    【leetcode】Search a 2D Matrix
    绑定方法与非绑定方法||反射||内置方法
    封装||property
    组合||抽象类||多态||鸭子类型
    在子类中重用父类的属性
    继承||派生||继承实现原理
    面向对象小练习
    面向对象编程
  • 原文地址:https://www.cnblogs.com/yangjing1314/p/10333195.html
Copyright © 2011-2022 走看看