Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Misc | Q1577 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.