idiotbear
05-21-2003, 02:35 PM
v new to javascript (I've always just relied on dreamweaver's built-in functions so far!), so apologies if this is ridiculously easy ;)
I'm trying to detect the user's screen depth, and if it's less than 16-bit, give them an alert. Here's my code. It doesn't work (no browser errors - it just doesn't do anything.)
<script type="text/javascript">
function depth()
{
var scrdepth=window.screen.colorDepth
if (scrdepth < 16)
window.alert("Your monitor is set to 8-bit colour, which means that this website's colours will not display properly. It is recommended that you adjust your display settings to at least 16-bit High Colour. Thank you.")
}
</script>
Then I call the function:
<body onload="depth()" etc etc...../>
Please help!
:confused:
I'm trying to detect the user's screen depth, and if it's less than 16-bit, give them an alert. Here's my code. It doesn't work (no browser errors - it just doesn't do anything.)
<script type="text/javascript">
function depth()
{
var scrdepth=window.screen.colorDepth
if (scrdepth < 16)
window.alert("Your monitor is set to 8-bit colour, which means that this website's colours will not display properly. It is recommended that you adjust your display settings to at least 16-bit High Colour. Thank you.")
}
</script>
Then I call the function:
<body onload="depth()" etc etc...../>
Please help!
:confused: