From 7d44d7f9e7cb73ff2b373f08cea13ea9958bb462 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Fri, 6 Nov 2015 12:24:06 -0500 Subject: Dimensions: outerWidth/Height include scrollbar Fixes gh-1729 Closes gh-2694 --- src/dimensions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dimensions.js') diff --git a/src/dimensions.js b/src/dimensions.js index 30b55fbc0..c5f49ac09 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -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 -- cgit v1.2.3