Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirect based upon color depth

Status
Not open for further replies.

khoury

Technical User
Aug 8, 2002
12
US
I have been searching every where for this but no one even mentions it. Javascript can detect the resolution and redirect accordingly but I have yet to see any indication that it can do that with the color depth. I know Javascript can detect color depth, using this I believe: window.screen.pixelDepth but all the scripts that have this are ones that display the information on a page for the user. Any ideas? Thanks in advance.

-Khoury
 
hi Khoury,

pixelDepth is NS specific - it doesn't exist in IE.

=========================================================
if (!succeed) try();
-jeff
 
sure -


function redirect() {
switch(screen.colorDepth) {
case 8:
location = "8bitColor.html";
break;

case 16:
location = "16bitColor.html";
break;

case 24:
location = "24bitColor.html";
break;

case 32:
location = "32bitColor.html";
break;
}
} =========================================================
if (!succeed) try();
-jeff
 
I wrapped it in <script language=&quot;JavaScript&quot;><!-- //--></script> but it didn't seem to work. Did I do something wrong? Sorry for being such a newb.
 
hi khoury,

you have to call the function somewhere:

[tt]<html>
<head>
<script language=&quot;javascript&quot;>
<!--
function redirect() {
switch(screen.colorDepth) {
case 8:
location = &quot;8bitColor.html&quot;;
break;

case 16:
location = &quot;16bitColor.html&quot;;
break;

case 24:
location = &quot;24bitColor.html&quot;;
break;

case 32:
location = &quot;32bitColor.html&quot;;
break;
}
}
//-->
</script>
</head>
<body onload=&quot;redirect();&quot;>
</body>
</html>
[/tt]

=========================================================
if (!succeed) try();
-jeff
 
YOU ROCK DUDE! Thank you so much. It seems to work perfectly. Thanks again.
 
I marked your post as helpful/expert. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top