Grow your CSS skills. Land your dream job.

Auto detect (with redirect) sreen res…

  • # July 19, 2009 at 9:14 pm

    Hi guys, building a site at the moment with a horizontal layout optimised for 1280 x 1024 using scrollto to navigate sideways. I’m not entirely comfortable with the result viewed at less resolution than that however – does not look good at all.

    I just don’t think that a fluid layout would work, is there a Javascript snippet I could use that would automatically detect the viewer’s screen res and redirect them to an appropriate stylesheet?

    Any sort of help or pointers greatly appreciated – I know nothing of Javascript I’m afraid, but even a good tut might do the trick…?

    # July 20, 2009 at 1:32 am

    I needed this once but ended up finding a different solution.

    http://www.pageresource.com/jscript/jscreen.htm

    or

    http://andylangton.co.uk/articles/javas … esolution/

    or

    http://www.java-scripts.net/javascripts … tion.phtml

    # July 20, 2009 at 11:12 am

    Excellent – I’ll have a look now. Thanks a mil! :)

    EDIT – Ok, your second link gave me what seems to be the ideal snippet:

    Code:

    None of the links however assume that I'm as Javascript ignorant as I truly, truly am - how do I implement this? I'm assuming this goes into a initial index page in the HEAD section, and then it automatically redirects someone to the ideal page without them noticing anything. Is this correct?

    # July 20, 2009 at 12:59 pm

    Yeah, you would put this particular script. Some scripts require an additional function call later in the body, but that is not the case with this one. I haven’t used the script so I’m not sure how noticable or unnoticable the redirect will appear to the user. Keep us updated and let me know if you need further help testing. :)

    # July 20, 2009 at 6:14 pm

    Coolaboola.

    Ta again!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".