From: John Resig Date: Wed, 29 Sep 2010 12:45:52 +0000 (-0700) Subject: Adjust fallback top/left to just be 0 for disconnected DOM nodes. Follow-up to cf672a... X-Git-Tag: 1.4.3rc1~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ec7ea3fba15379ebe8ddff5f6c99ec3faf8d6d17;p=jquery.git Adjust fallback top/left to just be 0 for disconnected DOM nodes. Follow-up to cf672a2e7a886cac5ae62f6772c6b4b43b19a2fc, thanks to @jitter for the catch. --- diff --git a/src/offset.js b/src/offset.js index 39763ee60..7f654d8f2 100644 --- a/src/offset.js +++ b/src/offset.js @@ -25,7 +25,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { box = elem.getBoundingClientRect(); } catch(e) { - box = { top: elem.offsetTop, left: elem.offsetLeft }; + box = { top: 0, left: 0 }; } var doc = elem.ownerDocument,