fixed = css(elem, "position") == "fixed";
// Use getBoundingClientRect if available
- if ( elem.getBoundingClientRect ) {
+ if ( !(mozilla && elem == document.body) && elem.getBoundingClientRect ) {
var box = elem.getBoundingClientRect();
// Add the document scroll offsets
},
offsetParent: function() {
- var offsetParent = this[0].offsetParent;
+ var offsetParent = this[0].offsetParent || document.body;
while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
offsetParent = offsetParent.offsetParent;
return jQuery(offsetParent);