Getting window dimensions currently fails in Nokia browsers, causing JS error (and...
authorscottjehl <scott@scottjehl.com>
Wed, 22 Dec 2010 20:24:07 +0000 (15:24 -0500)
committerscottjehl <scott@scottjehl.com>
Wed, 22 Dec 2010 20:24:07 +0000 (15:24 -0500)
src/dimensions.js

index f35b0ac..b4dae83 100644 (file)
@@ -36,7 +36,7 @@ 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 ];
+                               elem.document.body[ "client" + name ] || window.screen && window.screen[ name ];
 
                // Get document width or height
                } else if ( elem.nodeType === 9 ) {