Permalink
Browse files

Offset: getBounding doesn't return width/height in IE8. Fixes test.

  • Loading branch information...
timmywil committed Jun 16, 2015
1 parent 523de77 commit 3b1de112675a5c39410f3ba18c433a6ee4bd4e17
Showing with 7 additions and 14 deletions.
  1. +7 −14 src/offset.js
View
@@ -108,21 +108,14 @@ jQuery.fn.extend({
}
rect = elem.getBoundingClientRect();
+ win = getWindow( doc );
- // Make sure element is not hidden (display: none)
- if ( rect.width || rect.height ) {
- win = getWindow( doc );
-
- return {
- top: rect.top + ( win.pageYOffset || docElem.scrollTop ) -
- ( docElem.clientTop || 0 ),
- left: rect.left + ( win.pageXOffset || docElem.scrollLeft ) -
- ( docElem.clientLeft || 0 )
- };
- }
-
- // Return zeros for hidden elements
- return rect;
+ return {
+ top: rect.top + ( win.pageYOffset || docElem.scrollTop ) -
+ ( docElem.clientTop || 0 ),
+ left: rect.left + ( win.pageXOffset || docElem.scrollLeft ) -
+ ( docElem.clientLeft || 0 )
+ };
},
position: function() {

0 comments on commit 3b1de11

Please sign in to comment.