From b7b91d9148d607901c219f0cf5881546184f448d Mon Sep 17 00:00:00 2001 From: fay Date: Wed, 15 Aug 2018 10:34:34 +0800 Subject: [PATCH] BI-30166 --- src/core/jquery.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/jquery.js b/src/core/jquery.js index 6dd3208174..fe501ea191 100644 --- a/src/core/jquery.js +++ b/src/core/jquery.js @@ -9401,12 +9401,15 @@ jQuery.fn.offset = function( options ) { do{ offsetLeft += el.offsetLeft; offsetTop += el.offsetTop; - - offsetLeft -= el.scrollLeft; - offsetTop -= el.scrollTop; - el = el.offsetParent; } while( el ); + + var elm = elem; + do{ + offsetLeft -= elm.scrollLeft || 0; + offsetTop -= elm.scrollTop || 0; + elm = elm.parentNode; + } while( elm ); win = getWindow( doc ); return { top: offsetTop + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),