jquery ajax: closes #3231. The ajax setting 'dataFilter' can also parse the response.
[jquery.git] / src / offset.js
index ef999d8..1ae3f2e 100644 (file)
@@ -14,7 +14,7 @@ jQuery.fn.offset = function() {
                    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
@@ -132,7 +132,7 @@ jQuery.fn.extend({
        },
 
        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);