X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fdimensions.js;h=e2d411dd22897ee6e26c81c55f2943ad617ec316;hb=4a828c93d40eb67b2041b08bbed0f1973442bd03;hp=b4dae83c4b1d9efb59f24f009e56f7e3211cd39a;hpb=18fa1fd9da12fd6a259b422f91b663d9fbdb181e;p=jquery.git diff --git a/src/dimensions.js b/src/dimensions.js index b4dae83..e2d411d 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -25,7 +25,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { if ( !elem ) { return size == null ? null : this; } - + if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); @@ -35,8 +35,10 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { if ( jQuery.isWindow( elem ) ) { // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || - elem.document.body[ "client" + name ] || window.screen && window.screen[ name ]; + // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat + var docElemProp = elem.document.documentElement[ "client" + name ]; + return elem.document.compatMode === "CSS1Compat" && docElemProp || + elem.document.body[ "client" + name ] || docElemProp; // Get document width or height } else if ( elem.nodeType === 9 ) {