diff options
author | timmywil <timmywillisn@gmail.com> | 2011-09-30 17:50:07 -0400 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2011-09-30 17:50:48 -0400 |
commit | 1ebced173697421db5e0839d7ca092007455b42c (patch) | |
tree | 51f3dfcfb17c5f49edbb9655d0ad49fa0ec11c0c /src/dimensions.js | |
parent | 96a44a86d870f2634c82a4148d22d0a07044ba77 (diff) | |
download | jquery-1ebced173697421db5e0839d7ca092007455b42c.tar.gz jquery-1ebced173697421db5e0839d7ca092007455b42c.zip |
Add support for calling outer/inner Width/Height on the window and document. Fixes #9434.
Diffstat (limited to 'src/dimensions.js')
-rw-r--r-- | src/dimensions.js | 8 |
1 files changed, 6 insertions, 2 deletions
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; }; |