General discussion


Automatic Web Page Resolution

By stevenlschneider ·
I recieved a webmaster tip via email that said you could auto detect and adjust for a person logging onto your web site. It said you had to create a directory and pages for each resolution and have your site detect the resolution of the viewer and you can automatically swith them to the correct directory for viewing. I've tried and can't get the my site to switch. Any help would be appreciated. It says it can be accomplished by using a simple function in the HEAD of the code. The sample page given auto switches bu I can't get the code of the original page to compair. Here is the code:
function newResolution() {
var url640 = "/640/index.html";
var url800 = "/800/index.html";
var url1024 = "/1024/index.html";
if ((screen.width = = 640) && (screen.height == 480))
window.location.href= url640;
else if ((screen.width == 800) && (screen.height = = 600))
window.location.href= url800;
else if ((screen.width = = 1024) && (screen.height = = 768))
window.location.href= url1024;
else windo.locatio.href= url800;
Next, simply use onload in the BODY tag to run the function:
<BODY onload="newresolution()">
The sample page is:
any help would be appreciated. Thanks.
Can you get it to work? The

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Automatic Web Page Resolution

by Stoobydo In reply to Automatic Web Page Resolu ...

Noticed that your question was collecting dust. Try using They have discussion groups for web developers. They also have scripts that you can download. Although TechRepublic covers just about everything, I guess its hard to actually cover everything computer related!!

Related Discussions

Related Forums