Skip to content

Commit

Permalink
Offset: getBounding doesn't return width/height in IE8. Fixes test.
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Jun 16, 2015
1 parent 523de77 commit 3b1de11
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3b1de11

Please sign in to comment.