dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Resolution Check

  1. #1
    Join Date
    Jul 2004
    Location
    Long Island
    Posts
    9

    Question Resolution Check

    My site is built using CSS and looks good on most computers, however, on some computers where the resolution is set larger, it does not display properly. Is there a way for my site to check the viewers resolution and either make the change (temporarily) or suggest a change for better viewing?

    Any help would be appreciated.

  2. #2
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,147
    Here is a relevant link, but I haven't checked if it's valid: http://www.pageresource.com/jscript/jscreen.htm

  3. #3
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    screen.width returns the screen resolution's width. Testing just width should be enough. There's no 1024x769 as far as I know. So if the width is 1024, you know the height is 768

  4. #4
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Surely the internal size of the browser window is more relevant that the screen size since the existing toolbars on the screen plus the browser chrome can make even full screen browser windows completely different sizes.

    function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;}
    function pageHeight() {return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;}

  5. #5
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    The Ultimate Browser Sniffer is cool (it doesnt check resolution though... so bit off the subject but sometimes useful... www.wideopenwin.com/JavaScript/browsersniff.html

    I keep a copy just incase, It checks browser & version, OS & version, javascript & version...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles