mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Add support for calling outer/inner Width/Height on the window and document. Fixes #9434.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user