Click to See Complete Forum and Search --> : Resolution Check
mmazur
05-26-2005, 08:54 AM
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.
:confused:
DaveSW
05-26-2005, 08:56 AM
Here is a relevant link, but I haven't checked if it's valid: http://www.pageresource.com/jscript/jscreen.htm
JPnyc
05-26-2005, 10:03 AM
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
felgall
05-26-2005, 04:31 PM
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;}
bathurst_guy
06-25-2005, 12:43 PM
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...