mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Offset: getBounding doesn't return width/height in IE8. Fixes test.
This commit is contained in:
parent
523de777f9
commit
3b1de11267
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user