From 1ebced173697421db5e0839d7ca092007455b42c Mon Sep 17 00:00:00 2001 From: timmywil Date: Fri, 30 Sep 2011 17:50:07 -0400 Subject: Add support for calling outer/inner Width/Height on the window and document. Fixes #9434. --- src/dimensions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/dimensions.js') diff --git a/src/dimensions.js b/src/dimensions.js index d54776536..7df0d5ddf 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -8,16 +8,20 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { // innerHeight and innerWidth jQuery.fn[ "inner" + name ] = function() { var elem = this[0]; - return elem && elem.style ? + return elem ? + elem.style ? parseFloat( jQuery.css( elem, type, "padding" ) ) : + this[ type ]() : null; }; // outerHeight and outerWidth jQuery.fn[ "outer" + name ] = function( margin ) { var elem = this[0]; - return elem && elem.style ? + return elem ? + elem.style ? parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : + this[ type ]() : null; }; -- cgit v1.2.3