Skip to content

Commit

Permalink
core: fixed #2993: .offsetParent() will now return the body element i…
Browse files Browse the repository at this point in the history
…n all browsers for fixed position elements.
  • Loading branch information
scottgonzalez committed Jun 6, 2008
1 parent c90fe02 commit fa48ad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/offset.js
Expand Up @@ -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);
Expand Down

0 comments on commit fa48ad1

Please sign in to comment.