Commit fa48ad1d authored by Scott González's avatar Scott González

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

core: fixed #2993: .offsetParent() will now return the body element in all browsers for fixed position elements.
parent c90fe028
...@@ -132,7 +132,7 @@ jQuery.fn.extend({ ...@@ -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);
......
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