PDA

View Full Version : screen resoluions


indianleo
10-20-2007, 05:59 AM
Hello Friends I had made a website in which there are two screen resolutions
1 - 800X600
2 - 1024X768

Now i want that if the user have screen resolution 800X600 the file of 800X600 folder should start

and if the user have screen resolution 1024X768 the file of 1024X768 folder should start

m1a2x3x7
10-21-2007, 04:30 AM
To my knowledge theres nothing that will recognize resolution size. Just make your site 100% or just dont worry about 800x600. If someone still uses 800x600 res they need to upgrade form there 15in monitor.

neonfluxx
10-21-2007, 05:40 AM
you can also do a fixed width. ie 760 so it always fits all sizes.

davidj
10-21-2007, 09:49 AM
OK you can use JS to do this by using the screen.width and screen.height methods you can get the res of the users screen.
you will have to think of a way to accommodate those who dont use Javascript


<script language="javascript" type="text/javascript">

function goto(){

/// first set some constants ///
d = document.location;

/// here is the method of getting the dimensions ///
w = screen.width;
h = screen.height;

/// concat them both together
size = w+"x"+h;

/// lets use a switch to get the right location ///
switch(size){

/// add more cases below with a page location as needed ///
case '800x600' : p="page1.htm"; break;
case '1024x768' : p="page2.htm"; break;
case '1280x800' : p="page3.htm"; break;

}

/// return the value
return d.href=p;
}

</script>


to call the function just add an event like onload or onclick where ever and call the goto() function.

fwr1000
10-21-2007, 11:09 AM
What happens when the viewer has resized their window? Well, all of your careful planning goes down the drain and you end up with scroll bars.

davidj
10-21-2007, 11:18 AM
What happens when the viewer has resized their window? Well, all of your careful planning goes down the drain and you end up with scroll bars.

true but if you resize amazon or ebay eventually you will get scrollbars and i would imagine that careful planning would have played a big part of their development meetings.

Personaly i wouldnt use this as you have to have duplicate sites for each res to maintain. You could use this to change css files though

d a v e
10-21-2007, 01:35 PM
and the screen res doesn't tell you how big their browser is or whether they have their bookmarks pane open...

davidj
10-21-2007, 08:15 PM
or if the browser is at its maximum

domedia
10-22-2007, 12:38 PM
True, don't assume everyone running a 1024 is surfing with their browsers maximized.

indianleo
10-22-2007, 04:37 PM
Thank you friends for viewing my post and replying so Finally how to do it

davidj
10-22-2007, 06:56 PM
is that a question indianleo

indianleo
10-23-2007, 04:26 PM
yes so how should i do it

m1a2x3x7
10-23-2007, 05:27 PM
you dont worry about 800x600 or make it 100% so it will automatically adjust to the size of your browser.

indianleo
10-24-2007, 05:43 AM
<script language="javascript">
function fncLd()
{

if(screen.width <= 900)
{
window.navigate("800X600/index.htm");
}
if(screen.width >= 900)
{
window.navigate("1024X768/index.htm");
}
}
</script>


this code works but now the issue is when he types url suppose www.abc.com the index file takes him o the respective folder according to the screen size but its shows www.abc.com/1024X768/index.htm and I dont want the user to see the folder name such as 1024X768 because if he will copy this link and will send someone than no use of writing code So i want something like this www.abc.com/# which will be common

d a v e
10-24-2007, 06:56 AM
so you're not bothered that not everyone has their browser maximised then? :=

indianleo
10-24-2007, 01:41 PM
my issue is that when he click the url he sees www.abc.com/1024X768/index.htm or www.abc.com/800X600/index.htm

and I dont want them to see the screen resolutions

davidj
10-24-2007, 02:43 PM
change the naming convention of the directories to something else

domedia
10-24-2007, 03:25 PM
Changing dir names won't work because I dont want the user to see the folder name such as 1024X768 because if he will copy this link and will send someone than no use of writing code So i want something like this www.abc.com/# which will be common

davidj
10-24-2007, 03:51 PM
if you must do this then it doesnt matter if the user is directed to the wrong directory because you will have your screen test within each directory.

if a user jumps into 1024x768 and his res is 800x600 then just perform the test on the index and redirect to the correct page / directory

think you need to look at fluid CSS for this

wasovs4
11-11-2007, 07:50 AM
I Agree With DJ

lux
11-16-2007, 03:22 PM
Having 2 versions of the same website to cater for 2 screen resolutions is just silly, especially when it doesn't solve the problem.

Useful reading to get going on:

http://www.accessibility101.org.uk/tips/25.htm

Look at popular websites and see -> understand -> repeat their approach to the problem.

There is no right answer to this problem but there are certainly a number of other methods which are better than the one you are trying to use.

d a v e
11-16-2007, 03:30 PM
too right! :)