X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=src%2Fdimensions.js;h=e2d411dd22897ee6e26c81c55f2943ad617ec316;hp=f35b0acfb8020df6c5f5f43366c65422efed3c59;hb=9d306bd73bb47562cd52f0fc4cc158c534cfdfdf;hpb=fb48ae8e6cca25fd29ef2b1eb23e9efa7b0eef7c diff --git a/src/dimensions.js b/src/dimensions.js index f35b0ac..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 ]; + // 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 ) {