View Full Version : different page versions for different res.

03-10-2005, 07:34 PM
Need to figure out a few more things.

I want to make one page look basically the same on all the different resolutions.

So, I'm thinking I should make like 5 different versions of the same page.
How do I figure out what resolution the user has? After that, how do I tell my site which page version to display.

I want my preformatted paragraph to start at the center of the page, and be displayed down to a particular sentence without the user scrolling, regardless of their resolution. So, 5 different versions with different font sizes, to ensure on larger resolutions the paragraph stops at the same sentence before scrolling and revealing the whole paragraph.

Or, is there an easier way to do that?


03-10-2005, 07:57 PM
the easier way to do this would be to code using percents for widths and not pixels, but here is a link to one of the few many screen size detection and redirect scripts, you possibly modify it ot spit out different css files instead of making 5 different pages, http://www.dynamicdrive.com/dynamicindex9/info3.htm

03-11-2005, 01:53 AM
<script language="Javascript" type="text/javascript">
if (screen.width < 1024) {
document.write('<link rel=stylesheet type="text/css" href="smallres.css">');
if (screen.width >= 1024 && screen.width < 1280) {
document.write('<link rel=stylesheet type="text/css" href="mediumres.css">');
if (screen.width >= 1280) {
document.write('<link rel=stylesheet type="text/css" href="bigres.css">');

This way you only need to change thye CSS files for each screen resolution.

You can add to it and make it more specific.

<script language="Javascript" type="text/javascript">
if (screen.width = 800) {
document.write('<link rel=stylesheet type="text/css" href="800.css">');
if (screen.width = 1024) {
document.write('<link rel=stylesheet type="text/css" href="1024.css">');