Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 883 Bytes

Screen 对象.md

File metadata and controls

19 lines (12 loc) · 883 Bytes

Screen 对象

window.screen 对象包含有关用户屏幕的信息。

Screen API

上图是在 Chrome 控制台打印的 Screen 对象,其中显示了所有可用的属性和方法。

属性:

  • height/width — 返回当前屏幕的高度/宽度。(以像素为单位)
  • availHeight/availWidth — 可用的屏幕高度/宽度。
  • colorDepth — 返回屏幕的色彩深度。
  • pixelDepth — 获取屏幕的像素点。
  • orientation — 返回当前屏幕的转向。

更多资料

视口、设备和文档大小