Commit 3b1de112 authored by Timmy Willison's avatar Timmy Willison

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

parent 523de777
...@@ -108,21 +108,14 @@ jQuery.fn.extend({ ...@@ -108,21 +108,14 @@ jQuery.fn.extend({
} }
rect = elem.getBoundingClientRect(); rect = elem.getBoundingClientRect();
win = getWindow( doc );
// Make sure element is not hidden (display: none) return {
if ( rect.width || rect.height ) { top: rect.top + ( win.pageYOffset || docElem.scrollTop ) -
win = getWindow( doc ); ( docElem.clientTop || 0 ),
left: rect.left + ( win.pageXOffset || docElem.scrollLeft ) -
return { ( docElem.clientLeft || 0 )
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;
}, },
position: function() { position: function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment