首页 > 代码库 > js获得分辨率

js获得分辨率

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" 2 "http://www.w3.org/TR/html4/strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> 4  <head> 5   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6   <title>test</title> 7   <meta name="author" content="Administrator" /> 8   <!-- Date: 2011-10-25 --> 9   <script language="JavaScript">10 function a(){11 document.write(12 "屏幕分辨率为:"+screen.width+"*"+screen.height13 +"<br />"+14 "屏幕可用大小:"+screen.availWidth+"*"+screen.availHeight15 +"<br />"+16 "网页可见区域宽:"+document.body.clientWidth17 +"<br />"+18 "网页可见区域高:"+document.body.clientHeight19 +"<br />"+20 "网页可见区域宽(包括边线的宽):"+document.body.offsetWidth 21 +"<br />"+22 "网页可见区域高(包括边线的宽):"+document.body.offsetHeight 23 +"<br />"+24 "网页正文全文宽:"+document.body.scrollWidth25 +"<br />"+26 "网页正文全文高:"+document.body.scrollHeight27 +"<br />"+28 "网页被卷去的高:"+document.body.scrollTop29 +"<br />"+30 "网页被卷去的左:"+document.body.scrollLeft31 +"<br />"+32 "网页正文部分上:"+window.screenTop33 +"<br />"+34 "网页正文部分左:"+window.screenLeft35 +"<br />"+36 "屏幕分辨率的高:"+window.screen.height37 +"<br />"+38 "屏幕分辨率的宽:"+window.screen.width39 +"<br />"+40 "屏幕可用工作区高度:"+window.screen.availHeight41 +"<br />"+42 "屏幕可用工作区宽度:"+window.screen.availWidth43 );44 }45 </script>46   </head>47   48 <body onload="a()" >49 </body>50 </html>

 

js获得分辨率