PDA

View Full Version : detecting screen resolution


a_j
22-Dec-2003, 11:56 AM
does anyone have any good code for detecting screen resolution on a user's pc and directing them to different pages accordingly?

NormanRouxel
22-Dec-2003, 01:05 PM
Just search the web for "detecting screen resolution".

Here's what I found in under 30 seconds from start to finish on Google:-

This checks to see if your screen is 1024X768.
If so you get sent to the high resolution web page.
If not, you go to the low resolution page.

<SCRIPT language="JavaScript">
<!--
if ((screen.width>=1024) && (screen.height>=768))
{
window.location="highres.html";
}
else
{
window.location="lowres.html";
}
//-->
</SCRIPT>

Norman

a_j
22-Dec-2003, 04:26 PM
cheers, I'll try that out :)