screen对象
screen对象用于获取用户的屏幕信息。
语法:
window.screen.属性
对象属性:
<!DOCTYPE html>
<html>
<body>
<h3>Your Screen:</h3>
<script>
document.write("窗口可以使用的屏幕宽高: ");
document.write(window.screen.availWidth + "*" + screen.availHeight);
document.write("<br>");
document.write("屏幕的宽高: ");
document.write(screen.availWidth + "*" + window.screen.height);
document.write("<br>");
document.write("用户浏览器表示的颜色位数: ");
document.write(window.screen.colorDepth);
document.write("<br>");
document.write("用户浏览器表示的颜色位数(ps:IE不支持?亲测好像支持唉): ");
document.write(screen.pixelDepth);
</script>
<body>
</body>
</html>