首页 > 编程语言 > 详细

javascript : detect at the end of bottom

时间:2014-11-16 14:39:11      阅读:209      评论:0      收藏:0      [点我收藏+]
    function isScrollBottom() {
        var documentHeight = document.documentElement.scrollHeight;
        var winHeight = document.documentElement.clientHeight;
        var scrollPosition = winHeight + getScrollTop();
        return console.log(documentHeight == scrollPosition); 
    }

    function getScrollTop() {
        if (typeof pageYOffset != ‘undefined‘) {
            //most browsers except IE before #9
            return pageYOffset;
        }
        else {
            var B = document.body; //IE ‘quirks‘
            var D = document.documentElement; //IE with doctype
            D = (D.clientHeight) ? D : B;
            return D.scrollTop;
        }
    } 

 

javascript : detect at the end of bottom

原文:http://www.cnblogs.com/stooges/p/4101392.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!