码迷,mamicode.com
首页 > Web开发 > 详细

JS获取活动区域高和宽

时间:2016-07-12 23:29:07      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:

     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;

JS获取活动区域高和宽

标签:

原文地址:http://www.cnblogs.com/change4now/p/5665143.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!