获取浏览器滚动条高度

     var w3c = (document.getElementById) ? true : false;
            var agt = navigator.userAgent.toLowerCase();
            var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
            function IeTrueBody() {
                return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
            }
            function GetScrollTop() {
                return ie ? IeTrueBody().scrollTop : window.pageYOffset;
            } 

  

posted @ 2012-05-09 16:32  biubiubiu  阅读(407)  评论(0编辑  收藏  举报