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 7885262 commit 522b92cCopy full SHA for 522b92c
src/offset.js
@@ -125,11 +125,10 @@ jQuery.fn.extend( {
125
offsetParent !== doc.documentElement &&
126
jQuery.css( offsetParent, "position" ) === "static" ) {
127
128
- offsetParent = offsetParent.offsetParent;
+ offsetParent = offsetParent.offsetParent || doc.documentElement;
129
}
130
- if ( offsetParent &&
131
- offsetParent !== doc.documentElement && offsetParent !== elem &&
132
- offsetParent.nodeType === 1 ) {
+ if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 &&
+ jQuery.css( offsetParent, "position" ) !== "static" ) {
133
134
// Incorporate borders into its offset, since they are outside its content origin
135
parentOffset = jQuery( offsetParent ).offset();
0 commit comments