-
February 22nd, 2002, 04:12 PM
#1
script question
does anyone no a script that will check someones screen resolution when they click to enter your site and then take them to the appropriate site? i have a vague idea one could be written, just don't feel like trying is someone has a standard one (debugging is a bitch). Thanks
-
February 23rd, 2002, 01:05 AM
#2
Member
<SCRIPT LANGUAGE="JavaScript">
<!--
function redirectPage() {
var url640x480 = "url"; //put the urlĀ“s here
var url800x600 = "Url";
var url1024x768 = "url";
if ((screen.width == 640) && (screen.height == 480))
window.location.href= url640x480;
else if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else window.location.href= url800x600;
}
// -->
</SCRIPT>
</HEAD>
<BODY onload="redirectPage();">
that should do it
-
February 23rd, 2002, 01:34 AM
#3
Senior Member
fairly similar......hope these help eh
<SCRIPT LANGUAGE="JavaScript">
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 4 || browserName ==
"Microsoft Internet Explorer" && browserVer >= 4)
version = "1";
else if (browserName == "Netscape" && browserVer >= 3)
version = "2";
else
version = "3";
if (version == "1") {
var correctwidth=800
var correctheight=600
if (screen.width<correctwidth||screen.height<correctheight)
location="PAGE_FOR_LOW_SIZE.htm"
else
location="PAGE_FOR_HIGH_SIZE.htm"
}
if (version == "2") {
var toolkit = java.awt.Toolkit.getDefaultToolkit();
var screen_size = toolkit.getScreenSize();
var correctwidth=800
var correctheight=600
if (screen_size.width<correctwidth||screen_size.height<correctheight)
location="PAGE_FOR_LOW_SIZE.htm"
else
location="PAGE_FOR_HIGH_SIZE.htm"
}
if (version == "3")
location="DEFAULT_PAGE.htm"
</SCRIPT>
-
February 23rd, 2002, 01:41 AM
#4
thanks guys... i'll test the them and see which i like better
Learn like you are going to live forever, live like you are going to die tomorrow.
Propoganda
-
February 24th, 2002, 05:29 PM
#5
Why not just simply write the site to fit to 800x600 and be done with it? That's how a lot of sites do their things (ZDNet, for instance). On 640x480 you have to scroll, and on 1024x768 you get space at the sides.
Chris Shepherd
The Nelson-Shepherd cutoff: The point at which you realise someone is an idiot while trying to help them.
\"Well as far as the spelling, I speak fluently both your native languages. Do you even can try spell mine ?\" -- Failed Insult
Is your whole family retarded, or did they just catch it from you?
-
February 24th, 2002, 05:38 PM
#6
Design a site for the lower resolution users!! bad examples of web site design is http://uk.php.net Notice how in lower resolutions you have to scroll to the right?? They could have solved this by having the cells fit a certaoin percentage of the screen! This means all resolutions have a good deal!
-
February 24th, 2002, 11:20 PM
#7
chsh - i like 1024 better so it was easier to make 2... which i did. no problems.
Learn like you are going to live forever, live like you are going to die tomorrow.
Propoganda
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|