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-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=50170e618059d10132a5319c64660a631b095f44 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 3fb2917..dab053e 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,