X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fdimensions.js;h=3b74ded9b839c089d2faed74ce921b6eb53788f0;hb=6e5a6a26a7d802b3abdc32d3b49f4936d1f63cd7;hp=69cfc4513d20319313c03dd9ed699d5f12aaadd0;hpb=2adb9b2a0fab55301f66d1a293823ffa6649bdc9;p=jquery.git diff --git a/src/dimensions.js b/src/dimensions.js index 69cfc45..3b74ded 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -20,14 +20,14 @@ jQuery.each([ "Height", "Width" ], function(i, name){ jQuery.fn[ type ] = function( size ) { // Get window width or height var elem = this[0]; - if ( !elem ) return null; + if ( !elem ) { return null; } return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window? // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || elem.document.body[ "client" + name ] : // Get document width or height - (elem.nodeName === "#document") ? // is it a document + (elem.nodeType === 9) ? // is it a document // Either scroll[Width/Height] or offset[Width/Height], whichever is greater Math.max( elem.documentElement["client" + name],