JavaScript -- Screen

时间:2021-12-24 08:10:32

-----041-Screen.html-----

 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <title>标题</title>
 </head>
 <body>
 <ol>
 <script type="text/javascript">
     document.write("<li>屏幕宽度:" + screen.width);
     document.write("<li>屏幕高度:" + screen.height);
     document.write("<li>屏幕可用宽度:" + screen.availWidth);
     document.write("<li>屏幕可用高度:" + screen.availHeight);
     document.write("<li>Color Depth:" + screen.colorDepth);
     document.write("<li>Buffer Depth:" + screen.bufferDepth);
     document.write("<li>水平DPI:" + screen.deviceXDPI);
     document.write("<li>垂直DPI:" + screen.deviceYDPI);
     document.write("<li>Logical水平DPI:" + screen.logicalXDPI);
     document.write("<li>Logical垂直DPI:" + screen.logicalYDPI);//以上四个只有IE有
     document.write("<li>屏幕刷新率:" + screen.updateInterval);//IE是0,其他浏览器木定义
     document.write("<li>字体平滑:" + screen.fontSmoothingEnabled);//IE有
 </script>
 </ol>
 </body>
 </html>

JavaScript -- Screen