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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detecting screen resolution and redirecting

Status
Not open for further replies.

korndogg

Programmer
Jun 26, 2000
22
BA
I need a script to detect a screen resolution(800 x 600 or 1024 x 768) and to redirect to 800_600.html or 1024_768.html
:) thnx
 
the screen object holds this info - why do you wan to have different pages - won't this become a pain after a while?


if(screen.width == 1024)document.location.href = "1024_768.html
"


Bj
 
Try this ... it worked a treat for me !

<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor=&quot;#FFFFFF&quot;>
<SCRIPT language=&quot;JavaScript&quot;>
<!--
if ((screen.width ==544) && (screen.height == 376)) { window.location=&quot;R1.HTM&quot; }
if ((screen.width ==640) && (screen.height == 480)) { window.location=&quot;R2.HTM&quot; }
if ((screen.width ==720) && (screen.height == 512)) { window.location=&quot;R3.HTM&quot; }
if ((screen.width ==800) && (screen.height == 600)) { window.location=&quot;R4.HTM&quot; }
if ((screen.width ==1024) && (screen.height == 768)) { window.location=&quot;R5.HTM&quot; }
if ((screen.width ==1152) && (screen.height == 864)) { window.location=&quot;R6.HTM&quot; }
if ((screen.width ==1280) && (screen.height == 1024)) { window.location=&quot;R7.HTM&quot; }
if ((screen.width ==1600) && (screen.height == 1200)) { window.location=&quot;R8.HTM&quot; }
if ((screen.width ==1920) && (screen.height == 1200)) { window.location=&quot;R9.HTM&quot; }
//-->
</SCRIPT>
</BODY>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top