Click to See Complete Forum and Search --> : Screen Resolution Check........Again


susannem
04-07-2003, 01:23 PM
Thanks to the last person who replied to this question with a lecture on why we should never do this, noone else helped out, so I need to post this again.

I need a script that I will check the users screen resolution and if its 800x600 or less then it needs to prompt them letting them know that they will not be able to view the site with their current screen resolution.

Please do not reply with why we shouldn't do this, we have our reasons for needing this script.:D

mutus
04-07-2003, 01:50 PM
if(screen.width <= 800) alert('Too Low!');

That's the width of the screen (resolution)... Not necessarily related to what size window people use to view your pages (regardless of resolution).

khaki
04-07-2003, 01:58 PM
Hi susannem...

so... you met Vladdy, then? ;)

Vladdy is cool. His "lectures" are always well intentioned... but sometimes not as helpful as one would like.

I think that this is what you were looking for?
;) k

<html>
<head>
<script>
if (screen.width != 800) {
document.write('Best viewed at 800x600');
}
</script>
</head>
<body>
</body>
</html>

havik
04-07-2003, 02:28 PM
You could also put a notice that states:

if(screen.width <= 800)
alert('Page best viewed at yourheight x yourwidth\n
and with the browser window maximized.');

Just in case the user does have the required resolution but is surfing with the browser window at half size or something.

Havik