Screen colorDepth Property - Display an alternate background color for 8 bit screens - Javascript Browser Object Model

Javascript examples for Browser Object Model:Screen

Description

Screen colorDepth Property - Display an alternate background color for 8 bit screens

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<script>

if (screen.colorDepth <= 8)//  w w w .  j a  v a2s.c  o m
  //simple blue background color for 8 bit screens
  document.body.style.background = "#0000FF"
else
  //fancy blue background color for modern screens
  document.body.style.background = "#87CEFA"

</script>

</body>
</html>

Related Tutorials