Imaginx
asked on
Trying to find a cross broswer solution to find either the screen resolution or browser resolution.
$(window).width(); // returns width of browser viewport
$(document).width(); // returns width of HTML documentI have a php site that needs to know the screen resolution OR the browser resolution to correctly place an absolute position <div></div>
The OS's are OSX 10.6, WinXp Pro, Win 7 Pro
Browsers are IE6,IE7,IE8,IE9,Safari>5,m isc firefox ..
I can get document.width/document.he ight to work in safari.
I can't get it to work in IE
I can get mild success with the jquery library in IE, but not safari
(http://api.jquery.com/width/ :::
$(window).width(); // returns width of browser viewport
$(document).width(); // returns width of HTML document
)
What works all over the place ??
$(document).width(); // returns width of HTML documentI have a php site that needs to know the screen resolution OR the browser resolution to correctly place an absolute position <div></div>
The OS's are OSX 10.6, WinXp Pro, Win 7 Pro
Browsers are IE6,IE7,IE8,IE9,Safari>5,m
I can get document.width/document.he
I can't get it to work in IE
I can get mild success with the jquery library in IE, but not safari
(http://api.jquery.com/width/ :::
$(window).width(); // returns width of browser viewport
$(document).width(); // returns width of HTML document
)
What works all over the place ??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<!--[if IE 6]>
// put IE6 code in here
<![endif]-->
and so on for all the other browsers.