core: fixed #2993: .offsetParent() will now return the body element in all browsers for fixed position elements.

This commit is contained in:
Scott González 2008-06-06 00:28:33 +00:00
parent c90fe0283b
commit fa48ad1d1b

View File

@ -132,7 +132,7 @@ jQuery.fn.extend({
}, },
offsetParent: function() { 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') ) while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
offsetParent = offsetParent.offsetParent; offsetParent = offsetParent.offsetParent;
return jQuery(offsetParent); return jQuery(offsetParent);