Get the current screen size size

Source: Internet
Author: User

<title>获取当前对象大小以及屏幕分辨率等</title><body><div style=" width:88%;margin:30px auto; color:blue;" id="div_html"></div><script type="text/javascript">var s = ""; s += " 网页可见区域宽:"+ document.body.clientWidth+"<br />"; s += " 网页可见区域高:"+ document.body.clientHeight+"<br />"; s += " 网页可见区域宽:"+ document.body.offsetWidth + " (包括边线和滚动条的宽)"+"<br />"; s += " 网页可见区域高:"+ document.body.offsetHeight + " (包括边线的宽)"+"<br />"; s += " 网页正文全文宽:"+ document.body.scrollWidth+"<br />"; s += " 网页正文全文高:"+ document.body.scrollHeight+"<br />"; s += " 网页被卷去的高(ff):"+ document.body.scrollTop+"<br />"; s += " 网页被卷去的高(ie):"+ document.documentElement.scrollTop+"<br />"; s += " 网页被卷去的左:"+ document.body.scrollLeft+"<br />"; s += " 网页正文部分上:"+ window.screenTop+"<br />"; s += " 网页正文部分左:"+ window.screenLeft+"<br />"; s += " 屏幕分辨率的高:"+ window.screen.height+"<br />"; s += " 屏幕分辨率的宽:"+ window.screen.width+"<br />"; s += " 屏幕可用工作区高度:"+ window.screen.availHeight+"<br />"; s += " 屏幕可用工作区宽度:"+ window.screen.availWidth+"<br />"; s += " 你的屏幕设置是 "+ window.screen.colorDepth +" 位彩色"+"<br />"; s += " 你的屏幕设置 "+ window.screen.deviceXDPI +" 像素/英寸"+"<br />"; document.getElementById("div_html").innerHTML = s;</script></body>

Get the current screen size size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.