80 users online (1 members and 79 guests)  




  Results 1 to 4 of 4

Related

  1. Help Setting up Traffic Exchange    Forum: Databases
    Replies: 1
  2. IE6 default setting?    Forum: HTML Forum
    Replies: 4
  3. Setting Div widths    Forum: CSS Forum
    Replies: 0
  4. need help wit google message-your browser doen not support browser    Forum: Search Engine Optimization - SEO - Forum
    Replies: 4
  5. Setting up my own hosting?    Forum: Web Hosting Forum
    Replies: 3
  1. #1
    Brner's Avatar
    Disabled

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    7

    Browser Setting Sensor??

    Hi gang,

    Going through another learning lesson here. Having a bit of a time with a page I'm developing (not uploaded yet). I'd like the contents to be more "friendly" between browser settings. My question is.....if I develop two complete pages, one for each browser setting (I'm thinking (800x600) and (1024x768)), is there a code that would sense and direct the viewer to, (or let them choose), the correct page for their browser setting? Or......is there a better way to approach this?

    Thanks in advance,

    Don

  2. #2
    krak_d's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Liverpool
    Posts
    166
    Hi Brner,

    personally i design with 800x600 in mind but keep in mind larger and smaller resolutions by way of using percentages rather than pixels etc for specifying width!

    As for detecting the actual size! I'm aware of a browser detect JavaScript for redirecting to a page optimized for that specific browser but im not sure about detecting the size itself and redirecting.

    I'm sure a quick search would solve that but personally i wouldnt waste time designing 2 sites!

    krak_d

  3. #3
    Brner's Avatar
    Disabled

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    7
    Hi krak_d,

    Thanks for the input and I think that's the way I'll go in the future, although I have found the code that will sense and re-direct a browser on DynamicDrive site. Haven't tried it yet but think I'll play with it a bit anyway.

    The page in question was designed with a 1024x768 browser so I have to do another one anyway. As you can tell, I have a lot to learn but am catching on little by little.

    Again, thanks for the input,

    Don

  4. #4
    SSJ4 Bart's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Location
    The Netherlands
    Posts
    3
    Hello Brner,

    I don't know if you got it working already, but maybe this'll help:

    In javascript, 'screen.width' will give you the width of the user's screen in pixels, screen.width does the same for the screen's width. So if this gives 1024, you know s/he is using 1024x768 resolution.
    You could then redirect her/him to the proper site, based on that info. In total, it would look somewhat like this:

    Code:
    <script>
    <!--//
    
    if (screen.width==1024 && screen.height==768)
    {
    location.href="page_for_1024x768_resolution.html
    }
    
    if (screen.width==800 && screen.height==600)
    {
    location.href="page_for_800x600_resolution.html"
    }
    
    //-->
    </script>
    You can detect as many resolutions as you like this way, and direct the browser to the appropriate page.

    Another way is to name your pages so that you can use this:

    Code:
    <script>
    <!--//
    
    location.href="page_for_" + screen.width + "x" + screen.height + "_resolution.html"
    
    //-->
    </script>
    Last edited by SSJ4 Bart; 09-20-2004 at 10:07 AM.



Tags for this Thread