UNPKG

ll-package

Version:

2 lines (1 loc) 583 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(o){let t=o.pageXOffset;const e="scrollLeft";if(typeof t!="number"){const n=o.document;t=n.documentElement[e],typeof t!="number"&&(t=n.body[e])}return t}function r(o){let t,e;const n=o.ownerDocument,{body:c}=n,f=n&&n.documentElement,l=o.getBoundingClientRect();return t=l.left,e=l.top,t-=f.clientLeft||c.clientLeft||0,e-=f.clientTop||c.clientTop||0,{left:t,top:e}}function u(o){const t=r(o),e=o.ownerDocument,n=e.defaultView||e.parentWindow;return t.left+=i(n),t.left}exports.getOffsetLeft=u;