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

This commit is contained in:
Timmy Willison 2015-06-16 12:49:22 -04:00
parent 523de777f9
commit 3b1de11267

View File

@ -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() {