File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -160,24 +160,14 @@ jQuery.fn.extend( {
160160 } ;
161161 } ,
162162
163- // This method will return documentElement in the following cases:
164- // 1) For the element inside the iframe without offsetParent, this method will return
165- // documentElement of the parent window
166- // 2) For the hidden or detached element
167- // 3) For body or html element, i.e. in case of the html node - it will return itself
168- //
169- // but those exceptions were never presented as a real life use-cases
170- // and might be considered as more preferable results.
171- //
172- // This logic, however, is not guaranteed and can change at any point in the future
173163 offsetParent : function ( ) {
174164 return this . map ( function ( ) {
175- var offsetParent = this . offsetParent ;
165+ var offsetParent = this . offsetParent || docElem ;
176166
177- while ( offsetParent && jQuery . css ( offsetParent , "position" ) === "static" ) {
167+ while ( offsetParent && ( ! jQuery . nodeName ( offsetParent , "html" ) &&
168+ jQuery . css ( offsetParent , "position" ) === "static" ) ) {
178169 offsetParent = offsetParent . offsetParent ;
179170 }
180-
181171 return offsetParent || docElem ;
182172 } ) ;
183173 }
You can’t perform that action at this time.
0 commit comments