Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    Finding out viewers Screen Resolution

    Hi All...

    Is there anyway to detect what screen resolution a viewer is using. I would like to be able to detect this and if they are using a smaller resolution than what the site is best viewed with, suggest them to change.

    Ideally I would like to give them the option of changing their resolution eg. "This site is best viewed with a 1024x768 resolution! Would you like to change it?" and if they clicked OK for it to auto change (I know the alert would require JS) - but this I suppose is wishful thinking! LOL

    Thanks

    Taylor.

  • #2
    New Coder
    Join Date
    Jun 2004
    Location
    Newcastle, England
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You definitely can't do it with PHP, as it is server side not client side, so has nothing to do with the client. You might be able to do it with Javascript, but I know very little JS so can't help you there
    Beauty is in the eye of the beer-holder

    Man who smoke pot, choke on handle

  • #3
    New Coder
    Join Date
    Jun 2004
    Location
    Newcastle, England
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just looked it up that you can find it out using screen.height and screen.width in JS. Here is link:

    http://www.pageresource.com/jscript/jscreen.htm
    Beauty is in the eye of the beer-holder

    Man who smoke pot, choke on handle

  • #4
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    Thanks - that helped - I have simply put a "if resolution < 1024x768 to alert them and show them instructions on how to change it to the desired resolution"...

    And yep - its all javascript - so waiting to be moved to that forum! LOL

  • #5
    New Coder
    Join Date
    Jun 2004
    Location
    Newcastle, England
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Glad to b of help ... and yeh im awaiting the move as well lol
    Beauty is in the eye of the beer-holder

    Man who smoke pot, choke on handle


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •