JavaScript 参考手册
Screen colorDepth 属性
在8比特屏显示交替的背景颜色
源代码:
点击运行 »
<script> if (screen.colorDepth <= 8) //为8位屏幕的简单的蓝色背景色 document.body.style.background = "#0000FF" else //为现代屏幕的华丽的蓝色背景色 document.body.style.background = "#87CEFA" </script>
运行结果:
点击运行 »