How do I use the JS effect to display my screen resolution and screen size? Take a look at the following code:
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv=" Content-type " Content= "text/html; charset=gb2312 "/>
<title>js Test Monitor resolution </title>
<body>
<div sty Le= "width:1cm" id= "Hutia" ></div>
<script language= "JavaScript" >
document.write (' Your display resolution is : \ n ' + screen.width + ' * ' + screen.height + ' pixels<br/> ');
var ww = document.getElementById ("Hutia"). offsetwidth, W = screen.width/ww, h = screen.height/ww, r = Math.Round (Math. sqrt (w*w + h*h)/2.54);
document.write (' Your monitor size is: \ n ' + (SCREEN.WIDTH/WW). toFixed (1) + ' * ' + (SCREEN.HEIGHT/WW). toFixed (1) + ' cm, ' + R + ' inch < Br/> ');
</SCRIPT>
</body>