aboutsummaryrefslogtreecommitdiffstats
path: root/src/offset.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-06-06 00:28:33 +0000
committerScott González <scott.gonzalez@gmail.com>2008-06-06 00:28:33 +0000
commitfa48ad1d1be18482dbabe58182025a8d22dee236 (patch)
tree4f909be00286a50bde9cdad7869dc34eaaac42bb /src/offset.js
parentc90fe0283bac94327a8a8ec75e7292322c77dd01 (diff)
downloadjquery-fa48ad1d1be18482dbabe58182025a8d22dee236.tar.gz
jquery-fa48ad1d1be18482dbabe58182025a8d22dee236.zip
core: fixed #2993: .offsetParent() will now return the body element in all browsers for fixed position elements.
Diffstat (limited to 'src/offset.js')
-rw-r--r--src/offset.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/offset.js b/src/offset.js
index f0adae04d..1ae3f2e2f 100644
--- a/src/offset.js
+++ b/src/offset.js
@@ -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);