您好,欢迎访问一九零五行业门户网

JS 各种网页尺寸判断实例方法_javascript技巧

复制代码 代码如下:
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      } 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;
     }
 }
其它类似信息

推荐信息