Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1577 How do I detect the browser's color depth and change the background graphic/color accordingly?

You are here: irt.org | FAQ | JavaScript | Misc | Q1577 [ previous next ]

in Internet Explorer 4+ and Netscape Navigator 4+ only with something like:

<html>
<head>
<script language="JavaScript"><!--
var bg = '256.gif';

if (window.screen && window.screen.colorDepth > 8)
  bg = 'morecolours.jpg';

document.write('<body background="' bg + '">';
//--></script>
</head>

</body>
</html>

Feedback on 'Q1577 How do I detect the browser's color depth and change the background graphic/color accordingly?'

©2018 Martin Webb