Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Screen.pixelDepth

概述

返回屏幕的位深度/色彩深度(bit depth)。

语法

depth = window.screen.pixelDepth

示例

// 如果没有足够的位深度/色彩深度(bit depth),就选择一个更纯的颜色
if ( window.screen.pixelDepth > 8 ) {
  document.style.color = "#FAEBD7";
} else {
  document.style.color = "#FFFFFF";
}

规范

DOM Level 0 不属于任何标准.

相关链接

文档标签和贡献者

 此页面的贡献者: teoli, AlexChao
 最后编辑者: AlexChao,