PDA

View Full Version : 1 Page & 2 different Contents



kobo1d
07-16-2007, 01:54 PM
Hi again!

I just wondered, if its possible to read out the users screen resolution and then assign them to different content....
for example 1024x786 sees a different page, then a user with 1280x1024, but both actually calling one and the same page...
like a semi-dynamic content switch... depending on the users screen resolution...

thx for help !!

:)

djr33
07-16-2007, 02:10 PM
Possible in some situations, but not all, and very unreliable. On top of that, what about users who don't have the page filling the screen? Are you going to design a page to fix every possible set of dimensions?

Generally, it is a very bad idea as a web designer to create something that requires something from the user. Your site should adjust to fit their computer/screensize/browser/settings.
Though it is better than just displaying a single resolution, this solution won't solve several issues, so you're much better off just designing a site that will adjust itself to a reasonable size.

If your page must be a certain size, then simply make it at least that wide (using CSS, etc), then the window will need to be enlarged that much. (And I'm talking about like 500px, not 1024, etc.)
The only time this would really apply for large resolutions is if you had an image gallery, etc., for high resolution images, in which case the viewer should be expected to maximize the window, etc.

For a more detailed discussion, take a look here:
http://www.dynamicdrive.com/forums/showthread.php?t=22571

kobo1d
07-16-2007, 02:35 PM
hey thx for ya post !

well its not a complete website i need this for.. i know what you mean and my main page is made like that..
i mean the main page gets displayed nice on any dimension..

but what i need the code for is the intro page... you see its a page at front with a flash movie on it and a counter at bottom...
now the size and alignment of that (big) flash movie is very different on different dimensions...

so i need that code only for changing the movie size dynamic by screen resolution and the alignment of the counter...
like i have the embbed tag 2 times in the body (with 2 different sizes) and javascript activate the right one depending on the users screen resolution!

djr33
07-16-2007, 02:45 PM
Ah, yes, that is the one reasonable exception to the rule-- media content.

However, this is still very difficult, in that the screen size might not be equal to one of those. So you'd have to just guess, I suppose, based on their actual window size. I'm not sure what the best script is to accomplish this, but someone else should be able to help soon with that. However, still, it won't be entirely reliable. I'd default to the smaller one, probably, for the occasions it doesn't work.

Alternatives:
You might want to look into a method using ActionScript to readjust the flash elements, if there is a way to get window size.
You may also want to simply look into a percentage based flash object, though I have a feeling this isn't possible... but I can't remember for sure.

kobo1d
07-16-2007, 03:04 PM
hmm.. thanks for your input !

well yes.. its kinda guessing though, since it will be sure look everywhere a lil different..
but then i would take it a lil smaller then the standard, so it might fit everyhwere..

i will have a look if its possible with flash-only,
but im not thet genius at flash :rolleyes:

djr33
07-16-2007, 03:27 PM
The benefit to using flash is that it would likely be fairly universal, as ActionScript is consistent. With javascript and various implementations across different browsers, there can be a lot of inconsistencies, especially with system settings, etc.