zoukankan      html  css  js  c++  java
  • 判断滚动是否到达底部

    /判断是否滚动到底部
    function reachBottom(){
        var scrollTop = 0;
        var clientHeight = 0;
        var scrollHeight = 0;
        if(document.documentElement && document.documentElement.scrollTop) {
                scrollTop = document.documentElement.scrollTop;
        } else if (document.body) {
        scrollTop = document.body.scrollTop;
        }
        if(document.body.clientHeight && document.documentElement.clientHeight) {
                clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
        } else {
                clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
        }
        scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
        if(scrollTop + clientHeight >= scrollHeight) {
                return true;
        } else {
                return false;
        }
    }

    ios用window获取对象

  • 相关阅读:
    thinkphp url生成
    thinkphp url大小写
    thinkphp 伪静态
    thinkphp action参数绑定
    thinkphp 前置和后置操作
    thinkphp 控制器定义
    thingkphp 路由实例
    thinkphp 闭包支持
    thinkphp 静态路由
    thinkphp 正则路由
  • 原文地址:https://www.cnblogs.com/djdliu/p/5759899.html
Copyright © 2011-2022 走看看