From 50170e618059d10132a5319c64660a631b095f44 Mon Sep 17 00:00:00 2001 From: Russell Holbrook Date: Mon, 22 Nov 2010 18:26:46 -0500 Subject: [PATCH] jQuery.fn.offset no longer returns ClientRect object for disconnected elements Instead of returning box, which is a ClientRect, we take the top and left box values and place them into a generic object. --- src/offset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/offset.js b/src/offset.js index 3fb2917b2b..dab053e003 100644 --- a/src/offset.js +++ b/src/offset.js @@ -30,7 +30,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { // Make sure we're not dealing with a disconnected DOM node if ( !box || !jQuery.contains( docElem, elem ) ) { - return box || { top: 0, left: 0 }; + return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; } var body = doc.body,