该pixelDepth只读属性返回屏幕的像素深度。
像素深度是系统显示硬件每个像素使用的位数。
screen.pixelDepth
var x = "Pixel Depth: " + screen.pixelDepth;测试看看‹/›
所有浏览器完全支持pixelDepth属性:
属性 | |||||
pixelDepth | 是 | 是 | 是 | 是 | 是 |
返回值: | 一个数字,表示颜色分辨率,以每个像素为单位。 可能的值:
|
---|
此示例显示所有屏幕属性:
var txt = ""; txt += "<p>Total width/height: " + screen.width + "*" + screen.height + "</p>"; txt += "<p>Available width/height: " + screen.availWidth + "*" + screen.availHeight +"</p>"; txt += "<p>Color depth: " + screen.colorDepth + "</p>"; txt += "<p>Color resolution: " + screen.pixelDepth + "</p>"; document.write(txt);测试看看‹/›
screen参考:screen.availHeight属性
screen参考:screen.availWidth属性
screen参考:screen.height属性
screen参考:screen.width属性
screen参考:screen.colorDepth属性