访问者屏幕:可用宽度

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p id="demo"></p>
  6.  
  7. <script>
  8. document.getElementById("demo").innerHTML =
  9. "可用屏幕宽度是:" + screen.availWidth;
  10. </script>
  11.  
  12. </body>
  13. </html>