diff --git a/src/offset.js b/src/offset.js index fcd39ed05..f8fd0ec87 100644 --- a/src/offset.js +++ b/src/offset.js @@ -138,7 +138,7 @@ jQuery.fn.extend({ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } - return offsetParent; + return offsetParent || document.body; }); } }); diff --git a/test/index.html b/test/index.html index 9593e95a1..59dfad62d 100644 --- a/test/index.html +++ b/test/index.html @@ -305,6 +305,9 @@ Z
+