From: Russell Holbrook Date: Mon, 22 Nov 2010 23:26:46 +0000 (-0500) Subject: jQuery.fn.offset no longer returns ClientRect object for disconnected elements X-Git-Tag: 1.5rc1~43^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=50170e618059d10132a5319c64660a631b095f44;p=jquery.git 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. --- diff --git a/src/offset.js b/src/offset.js index 3fb2917b2..dab053e00 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,