We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40dcc76 commit 0e4477cCopy full SHA for 0e4477c
src/offset.js
@@ -90,10 +90,17 @@ jQuery.fn.extend({
90
return;
91
}
92
93
+ // Support: IE<=11+
94
+ // Running getBoundingClientRect on a
95
+ // disconnected node in IE throws an error
96
+ if ( !elem.getClientRects().length ) {
97
+ return { top: 0, left: 0 };
98
+ }
99
+
100
rect = elem.getBoundingClientRect();
101
- // Make sure element is not hidden (display: none) or disconnected
- if ( rect.width || rect.height || elem.getClientRects().length ) {
102
+ // Make sure element is not hidden (display: none)
103
+ if ( rect.width || rect.height ) {
104
doc = elem.ownerDocument;
105
win = getWindow( doc );
106
docElem = doc.documentElement;
0 commit comments