diff options
-rw-r--r-- | src/core.js | 3 | ||||
-rw-r--r-- | src/offset.js | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/core.js b/src/core.js index b1ae40875..5fb6828ff 100644 --- a/src/core.js +++ b/src/core.js @@ -10,8 +10,9 @@ var core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) - document = window.document, location = window.location, + document = window.document, + docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, diff --git a/src/offset.js b/src/offset.js index fc110f012..b616a49a0 100644 --- a/src/offset.js +++ b/src/offset.js @@ -125,13 +125,13 @@ jQuery.fn.extend({ offsetParent: function() { return this.map(function() { - var offsetParent = this.offsetParent || document.documentElement; + var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } - return offsetParent || document.documentElement; + return offsetParent || docElem; }); } }); |