On 9/17/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> don't ever do browser sniffing if you want actually do object detection.
> furthermore I wouldn't automatically assume that there is
> document.documentElement (IE in Standards Mode only!)...
>
>
> My proposal:
>
> $.clientCoords = function() {
> var dimensions = {width: 0, height: 0};
> if (document.documentElement) {
> dimensions.width = document.documentElement.offsetWidth;
> dimensions.height = document.documentElement.offsetHeight;
> } else if (window.innerWidth && window.innerHeight) {
> dimensions.width = window.innerWidth;
> dimensions.height = window.innerHeight;
> }
> return dimensions;
> }
>
Thanks, I'll use it.
--
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/