Getting the width and height of the document now returns the correct value in all...
authorBrandon Aaron <brandon.aaron@gmail.com>
Thu, 13 Dec 2007 03:46:48 +0000 (03:46 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Thu, 13 Dec 2007 03:46:48 +0000 (03:46 +0000)
src/core.js

index a37ae78..53d5f4a 100644 (file)
@@ -1311,8 +1311,11 @@ jQuery.each([ "Height", "Width" ], function(i, name){
                
                        // Get document width or height
                        this[0] == document ?
-                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater (Mozilla reports scrollWidth the same as offsetWidth)
-                               Math.max( document.body[ "scroll" + name ], document.body[ "offset" + name ] ) :
+                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+                               Math.max( 
+                                       Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), 
+                                       Math.max(document.body["offset" + name], document.documentElement["offset" + name]) 
+                               ) :
 
                                // Get or set width or height on the element
                                size == undefined ?