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;
         }
     }
  • 相关阅读:
    Win10安装组策略功能
    IIS 站点批量迁移
    MongoDB 异常记录
    微信Web开发者工具
    NHibernate 异常
    Git 常用命令
    IIS 反向代理
    CSS应用
    Oracle
    Android之ActionBar学习
  • 原文地址:https://www.cnblogs.com/ahwu/p/3028101.html
Copyright © 2011-2022 走看看