JS获取活动区域高和宽

     var width;
            var height;
            //获取窗口宽度
            if (window.innerWidth)
                width = window.innerWidth;
            else if ((document.body) && (document.body.clientWidth))
                width = document.body.clientWidth;
            //获取窗口高度
            if (window.innerHeight)
                height = window.innerHeight;
            else if ((document.body) && (document.body.clientHeight))
                height = document.body.clientHeight;

posted @ 2016-07-12 22:29  change_4_now  阅读(238)  评论(0编辑  收藏  举报