mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
core: fixed #2993: .offsetParent() will now return the body element in all browsers for fixed position elements.
This commit is contained in:
parent
c90fe0283b
commit
fa48ad1d1b
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user