Dimensions: outerWidth/Height include scrollbar

Fixes gh-1729
Closes gh-2694
This commit is contained in:
Dave Methvin
2015-11-06 12:24:06 -05:00
parent 2cb8ebadcb
commit 7d44d7f9e7
2 changed files with 47 additions and 44 deletions

View File

@@ -19,10 +19,10 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ "client" + name ];
// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
return funcName.indexOf( "outer" ) === 0 ?
elem[ "inner" + name ] :
elem.document.documentElement[ "client" + name ];
}
// Get document width or height