mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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.
This commit is contained in:
parent
0838bdf52c
commit
50170e6180
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user