mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Offset: return zeros for disconnected/hidden elements
Fixes gh-2310 Close gh-2396
This commit is contained in:
@@ -39,7 +39,7 @@ jQuery.offset = {
|
||||
elem.style.position = "relative";
|
||||
}
|
||||
|
||||
curOffset = curElem.offset() || { top: 0, left: 0 };
|
||||
curOffset = curElem.offset();
|
||||
curCSSTop = jQuery.css( elem, "top" );
|
||||
curCSSLeft = jQuery.css( elem, "left" );
|
||||
calculatePosition = ( position === "absolute" || position === "fixed" ) &&
|
||||
@@ -110,6 +110,9 @@ jQuery.fn.extend({
|
||||
( docElem.clientLeft || 0 )
|
||||
};
|
||||
}
|
||||
|
||||
// Return zeros for disconnected and hidden elements (gh-2310)
|
||||
return rect;
|
||||
},
|
||||
|
||||
position: function() {
|
||||
|
||||
Reference in New Issue
Block a user