core: fixed #2993: .offsetParent() will now return the body element in all browsers...
authorScott González <scott.gonzalez@gmail.com>
Fri, 6 Jun 2008 00:28:33 +0000 (00:28 +0000)
committerScott González <scott.gonzalez@gmail.com>
Fri, 6 Jun 2008 00:28:33 +0000 (00:28 +0000)
src/offset.js

index f0adae0..1ae3f2e 100644 (file)
@@ -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);