PSP Hacks - Forums
Go Back   PSP Hacks - Forums > Tech Talk > PC Programming

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2008, 02:14 PM
Ollie Ollie is offline
PSP Ninja
 
Join Date: Oct 2005
Location: Paphos
Posts: 763
Ollie User Has a Beginner Reputation
Default

OK then so im making a website for a company but im going to making it using flash and graphics made in Photoshop. So obviously, I dont want to stretch the page greatly by making graphics suited to 1280x1024 and have the page stretched for users with an 800x600 screen resolution. So I made a code in JavaScript which is supposed to forward you to a page depending on your screen resolution, so I put it into my homepage [index.htm] where the code is like so:
Code:
<html>

<head>
<script language="Javascript1.1">

function detect(){
if(screen.width=1280||screen.height=1024){
location.href('index3.htm');
if(screen.width=1024||screen.height=768){
location.href('index2.htm');
if(screen.width=800||screen.height=600){
location.href('index1.htm');
}

}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>

<body onLoad="detect()" bgcolor="#FF0000">
</body>

</html>
So as you can see it will forward you to index3 if your screen reso is 1280x1024, etc.

The only thing is if the screen reso is 800x600 it wont forward me to index1.htm but it forwards me to index2.htm instead.

Any idea whats wrong?

EDIT - Could I also replace '=' with '<='? would the script still work fine?

Thanks
__________________
Reply With Quote
  #2  
Old 07-18-2008, 09:19 PM
gold2040's Avatar
gold2040 gold2040 is offline
PSP Guru
 
Join Date: Jul 2006
Location: .:: UK ::.
Posts: 1,792
gold2040 is on a distinguished road
Default

why not just use a Liquid CSS layout?

this also seems useful
http://www.sitepoint.com/blogs/2007/...-html-and-css/
__________________
PSPDosbox ---> Compatibility List :D
Want to contribute, PM me

Reply With Quote
Reply

 



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:19 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©