首页 技术 正文
技术 2022年11月11日
0 收藏 811 点赞 2,618 浏览 1251 个字

网页可见区域宽: document.body.clientWidth
网页可见区域高: document.body.clientHeight
网页可见区域宽: document.body.offsetWidth (包括边线的宽)
网页可见区域高: document.body.offsetHeight (包括边线的高)
网页正文全文宽: document.body.scrollWidth
网页正文全文高: document.body.scrollHeight
网页被卷去的高: document.body.scrollTop
网页被卷去的左: document.body.scrollLeft
网页正文部分上: window.screenTop
网页正文部分左: window.screenLeft
屏幕分辨率的高: window.screen.height
屏幕分辨率的宽: window.screen.width
屏幕可用工作区高度: window.screen.availHeight
屏幕可用工作区宽度: window.screen.availWidth

scrollHeight = 元素内容宽度所占据的高度 + 上下padding值 

scrollWidth = 元素内容宽度所占据的宽度 + 左右padding值  

<script language=”javascript”>
function screenInfo(){
    var  s = “”;
   s += “\r\n网页可见区域宽:”+ document.body.clientWidth;
   s += “\r\n网页可见区域高:”+ document.body.clientHeight;
   s += “\r\n网页可见区域宽:”+ document.body.offsetWidth  +” (包括边线的宽)”;
   s += “\r\n网页可见区域高:”+ document.body.offsetHeight +” (包括边线的宽)”;
   s += “\r\n网页正文全文宽:”+ document.body.scrollWidth;
   s += “\r\n网页正文全文高:”+ document.body.scrollHeight;
   s += “\r\n网页被卷去的高:”+ document.body.scrollTop;
   s += “\r\n网页被卷去的左:”+ document.body.scrollLeft;
   s += “\r\n网页正文部分上:”+ window.screenTop;
   s += “\r\n网页正文部分左:”+ window.screenLeft;
   s += “\r\n屏幕分辨率的高:”+ window.screen.height;
   s += “\r\n屏幕分辨率的宽:”+ window.screen.width;
   s += “\r\n屏幕可用工作区高度:”+ window.screen.availHeight;
   s += “\r\n屏幕可用工作区宽度:”+ window.screen.availWidth;
   alert(s);
}
</script>

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,029
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,519
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,367
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,146
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,781
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,859