@whitesev/domutils 1.5.11 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.amd.js +43 -75
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +43 -75
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +43 -75
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +43 -75
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +43 -75
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +43 -75
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/DOMUtils.d.ts +6 -6
- package/dist/types/src/types/DOMUtilsEvent.d.ts +2 -1
- package/package.json +5 -3
- package/src/DOMUtils.ts +86 -257
- package/src/DOMUtilsCommonUtils.ts +1 -4
- package/src/DOMUtilsData.ts +1 -3
- package/src/DOMUtilsEvent.ts +40 -174
- package/src/types/DOMUtilsEvent.d.ts +2 -1
package/dist/index.umd.js
CHANGED
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
};
|
|
285
285
|
|
|
286
286
|
// This is the minified and stringified code of the worker-timers-worker package.
|
|
287
|
-
const worker = `(()=>{var e={455:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),
|
|
287
|
+
const worker = `(()=>{var e={455:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o('The handler of the method called "'.concat(t,'" returned an unexpected result.'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o('The requested method called "'.concat(e,'" is not supported.'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o('The handler of the method called "'.concat(t,'" returned no required result.'),e))(i);const l=r instanceof Promise?await r:r;if(null===a){if(void 0!==l.result)throw s(i)}else{if(void 0===l.result)throw s(i);const{result:e,transferables:r=[]}=l;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,(()=>{n(),t.close(),u.delete(o)})),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])}))){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),l=(e,t,r=()=>!0)=>{const n=c(l,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},d=(e,t)=>r=>{const n=t.get(r);if(void 0===n)return Promise.resolve(!1);const[o,s]=n;return e(o),t.delete(r),s(!1),Promise.resolve(!0)},f=(e,t,r,n)=>(o,s,a)=>{const i=o+s-t.timeOrigin,u=i-t.now();return new Promise((t=>{e.set(a,[r(n,u,i,e,t,a),t])}))},m=new Map,h=d(globalThis.clearTimeout,m),p=new Map,v=d(globalThis.clearTimeout,p),w=((e,t)=>{const r=(n,o,s,a)=>{const i=n-e.now();i>0?o.set(a,[t(r,i,n,o,s,a),s]):(o.delete(a),s(!0))};return r})(performance,globalThis.setTimeout),g=f(m,performance,globalThis.setTimeout,w),T=f(p,performance,globalThis.setTimeout,w);l(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?h(e):v(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?g:T)(e,t,r)})})})()})();`; // tslint:disable-line:max-line-length
|
|
288
288
|
|
|
289
289
|
const loadOrReturnBroker = createLoadOrReturnBroker(load, worker);
|
|
290
290
|
const clearInterval = (timerId) => loadOrReturnBroker().clearInterval(timerId);
|
|
@@ -606,8 +606,7 @@
|
|
|
606
606
|
: event.target;
|
|
607
607
|
let totalParent = elementItem;
|
|
608
608
|
if (DOMUtilsCommonUtils.isWin(totalParent)) {
|
|
609
|
-
if (totalParent ===
|
|
610
|
-
DOMUtilsContext.windowApi.document) {
|
|
609
|
+
if (totalParent === DOMUtilsContext.windowApi.document) {
|
|
611
610
|
totalParent = DOMUtilsContext.windowApi.document.documentElement;
|
|
612
611
|
}
|
|
613
612
|
}
|
|
@@ -675,8 +674,7 @@
|
|
|
675
674
|
if (typeof currentParam === "boolean") {
|
|
676
675
|
option.capture = currentParam;
|
|
677
676
|
}
|
|
678
|
-
else if (typeof currentParam === "object" &&
|
|
679
|
-
"capture" in currentParam) {
|
|
677
|
+
else if (typeof currentParam === "object" && "capture" in currentParam) {
|
|
680
678
|
option.capture = currentParam.capture;
|
|
681
679
|
}
|
|
682
680
|
return option;
|
|
@@ -738,8 +736,7 @@
|
|
|
738
736
|
// 目标函数、事件名
|
|
739
737
|
isRemoveAll = true;
|
|
740
738
|
}
|
|
741
|
-
else if ((args.length === 3 && typeof args[2] === "string") ||
|
|
742
|
-
Array.isArray(args[2])) {
|
|
739
|
+
else if ((args.length === 3 && typeof args[2] === "string") || Array.isArray(args[2])) {
|
|
743
740
|
// 目标函数、事件名、子元素选择器
|
|
744
741
|
isRemoveAll = true;
|
|
745
742
|
}
|
|
@@ -754,9 +751,7 @@
|
|
|
754
751
|
for (let index = 0; index < handlers.length; index++) {
|
|
755
752
|
let handler = handlers[index];
|
|
756
753
|
let flag = true;
|
|
757
|
-
if (flag &&
|
|
758
|
-
listenerCallBack &&
|
|
759
|
-
handler.originCallBack !== listenerCallBack) {
|
|
754
|
+
if (flag && listenerCallBack && handler.originCallBack !== listenerCallBack) {
|
|
760
755
|
// callback不同
|
|
761
756
|
flag = false;
|
|
762
757
|
}
|
|
@@ -816,9 +811,7 @@
|
|
|
816
811
|
return;
|
|
817
812
|
}
|
|
818
813
|
let elementEvents = elementItem[symbolEvents] || {};
|
|
819
|
-
let iterEventNameList = eventTypeList.length
|
|
820
|
-
? eventTypeList
|
|
821
|
-
: Object.keys(elementEvents);
|
|
814
|
+
let iterEventNameList = eventTypeList.length ? eventTypeList : Object.keys(elementEvents);
|
|
822
815
|
iterEventNameList.forEach((eventName) => {
|
|
823
816
|
let handlers = elementEvents[eventName];
|
|
824
817
|
if (!handlers) {
|
|
@@ -855,8 +848,7 @@
|
|
|
855
848
|
try {
|
|
856
849
|
if (DOMUtilsContext.windowApi.document.readyState === "complete" ||
|
|
857
850
|
(DOMUtilsContext.windowApi.document.readyState !== "loading" &&
|
|
858
|
-
!DOMUtilsContext.windowApi.document.documentElement
|
|
859
|
-
.doScroll)) {
|
|
851
|
+
!DOMUtilsContext.windowApi.document.documentElement.doScroll)) {
|
|
860
852
|
return true;
|
|
861
853
|
}
|
|
862
854
|
else {
|
|
@@ -1491,7 +1483,7 @@
|
|
|
1491
1483
|
super(option);
|
|
1492
1484
|
}
|
|
1493
1485
|
/** 版本号 */
|
|
1494
|
-
version = "2025.
|
|
1486
|
+
version = "2025.8.9";
|
|
1495
1487
|
attr(element, attrName, attrValue) {
|
|
1496
1488
|
let DOMUtilsContext = this;
|
|
1497
1489
|
if (typeof element === "string") {
|
|
@@ -1585,15 +1577,7 @@
|
|
|
1585
1577
|
* 把纯数字没有px的加上
|
|
1586
1578
|
*/
|
|
1587
1579
|
function handlePixe(propertyName, propertyValue) {
|
|
1588
|
-
let allowAddPixe = [
|
|
1589
|
-
"width",
|
|
1590
|
-
"height",
|
|
1591
|
-
"top",
|
|
1592
|
-
"left",
|
|
1593
|
-
"right",
|
|
1594
|
-
"bottom",
|
|
1595
|
-
"font-size",
|
|
1596
|
-
];
|
|
1580
|
+
let allowAddPixe = ["width", "height", "top", "left", "right", "bottom", "font-size"];
|
|
1597
1581
|
if (typeof propertyValue === "number") {
|
|
1598
1582
|
propertyValue = propertyValue.toString();
|
|
1599
1583
|
}
|
|
@@ -1635,8 +1619,7 @@
|
|
|
1635
1619
|
return;
|
|
1636
1620
|
}
|
|
1637
1621
|
let setStyleProperty = (propertyName, propertyValue) => {
|
|
1638
|
-
if (typeof propertyValue === "string" &&
|
|
1639
|
-
propertyValue.trim().endsWith("!important")) {
|
|
1622
|
+
if (typeof propertyValue === "string" && propertyValue.trim().endsWith("!important")) {
|
|
1640
1623
|
propertyValue = propertyValue
|
|
1641
1624
|
.trim()
|
|
1642
1625
|
.replace(/!important$/gi, "")
|
|
@@ -1650,9 +1633,7 @@
|
|
|
1650
1633
|
};
|
|
1651
1634
|
if (typeof property === "string") {
|
|
1652
1635
|
if (value == null) {
|
|
1653
|
-
return DOMUtilsContext.windowApi.globalThis
|
|
1654
|
-
.getComputedStyle(element)
|
|
1655
|
-
.getPropertyValue(property);
|
|
1636
|
+
return DOMUtilsContext.windowApi.globalThis.getComputedStyle(element).getPropertyValue(property);
|
|
1656
1637
|
}
|
|
1657
1638
|
else {
|
|
1658
1639
|
setStyleProperty(property, value);
|
|
@@ -1755,12 +1736,8 @@
|
|
|
1755
1736
|
return transformInfo;
|
|
1756
1737
|
}
|
|
1757
1738
|
let elementTransform = DOMUtilsContext.windowApi.globalThis.getComputedStyle(element).transform;
|
|
1758
|
-
if (elementTransform != null &&
|
|
1759
|
-
|
|
1760
|
-
elementTransform !== "") {
|
|
1761
|
-
let elementTransformSplit = elementTransform
|
|
1762
|
-
.match(/\((.+)\)/)?.[1]
|
|
1763
|
-
.split(",");
|
|
1739
|
+
if (elementTransform != null && elementTransform !== "none" && elementTransform !== "") {
|
|
1740
|
+
let elementTransformSplit = elementTransform.match(/\((.+)\)/)?.[1].split(",");
|
|
1764
1741
|
if (elementTransformSplit) {
|
|
1765
1742
|
transform_left = Math.abs(parseInt(elementTransformSplit[4]));
|
|
1766
1743
|
transform_top = Math.abs(parseInt(elementTransformSplit[5]));
|
|
@@ -1798,8 +1775,7 @@
|
|
|
1798
1775
|
}
|
|
1799
1776
|
if (value == null) {
|
|
1800
1777
|
// 获取
|
|
1801
|
-
if (element.localName === "input" &&
|
|
1802
|
-
(element.type === "checkbox" || element.type === "radio")) {
|
|
1778
|
+
if (element.localName === "input" && (element.type === "checkbox" || element.type === "radio")) {
|
|
1803
1779
|
return element.checked;
|
|
1804
1780
|
}
|
|
1805
1781
|
else {
|
|
@@ -1808,8 +1784,7 @@
|
|
|
1808
1784
|
}
|
|
1809
1785
|
else {
|
|
1810
1786
|
// 设置
|
|
1811
|
-
if (element.localName === "input" &&
|
|
1812
|
-
(element.type === "checkbox" || element.type === "radio")) {
|
|
1787
|
+
if (element.localName === "input" && (element.type === "checkbox" || element.type === "radio")) {
|
|
1813
1788
|
element.checked = !!value;
|
|
1814
1789
|
}
|
|
1815
1790
|
else {
|
|
@@ -2063,7 +2038,15 @@
|
|
|
2063
2038
|
}
|
|
2064
2039
|
function elementAppendChild(ele, text) {
|
|
2065
2040
|
if (typeof content === "string") {
|
|
2066
|
-
ele
|
|
2041
|
+
if (ele instanceof DocumentFragment) {
|
|
2042
|
+
if (typeof text === "string") {
|
|
2043
|
+
text = DOMUtilsContext.parseHTML(text, true, false);
|
|
2044
|
+
}
|
|
2045
|
+
ele.appendChild(text);
|
|
2046
|
+
}
|
|
2047
|
+
else {
|
|
2048
|
+
ele.insertAdjacentHTML("beforeend", DOMUtilsCommonUtils.getSafeHTML(text));
|
|
2049
|
+
}
|
|
2067
2050
|
}
|
|
2068
2051
|
else {
|
|
2069
2052
|
ele.appendChild(text);
|
|
@@ -2074,6 +2057,7 @@
|
|
|
2074
2057
|
let fragment = DOMUtilsContext.windowApi.document.createDocumentFragment();
|
|
2075
2058
|
content.forEach((ele) => {
|
|
2076
2059
|
if (typeof ele === "string") {
|
|
2060
|
+
// 转为元素
|
|
2077
2061
|
ele = DOMUtilsContext.parseHTML(ele, true, false);
|
|
2078
2062
|
}
|
|
2079
2063
|
fragment.appendChild(ele);
|
|
@@ -2109,7 +2093,13 @@
|
|
|
2109
2093
|
return;
|
|
2110
2094
|
}
|
|
2111
2095
|
if (typeof content === "string") {
|
|
2112
|
-
element
|
|
2096
|
+
if (element instanceof DocumentFragment) {
|
|
2097
|
+
content = DOMUtilsContext.parseHTML(content, true, false);
|
|
2098
|
+
element.prepend(content);
|
|
2099
|
+
}
|
|
2100
|
+
else {
|
|
2101
|
+
element.insertAdjacentHTML("afterbegin", DOMUtilsCommonUtils.getSafeHTML(content));
|
|
2102
|
+
}
|
|
2113
2103
|
}
|
|
2114
2104
|
else {
|
|
2115
2105
|
let $firstChild = element.firstChild;
|
|
@@ -2282,16 +2272,14 @@
|
|
|
2282
2272
|
return;
|
|
2283
2273
|
}
|
|
2284
2274
|
if (DOMUtilsCommonUtils.isWin(element)) {
|
|
2285
|
-
return DOMUtilsContext.windowApi.window.document.documentElement
|
|
2286
|
-
.clientWidth;
|
|
2275
|
+
return DOMUtilsContext.windowApi.window.document.documentElement.clientWidth;
|
|
2287
2276
|
}
|
|
2288
2277
|
if (element.nodeType === 9) {
|
|
2289
2278
|
/* Document文档节点 */
|
|
2290
2279
|
element = element;
|
|
2291
2280
|
return Math.max(element.body.scrollWidth, element.documentElement.scrollWidth, element.body.offsetWidth, element.documentElement.offsetWidth, element.documentElement.clientWidth);
|
|
2292
2281
|
}
|
|
2293
|
-
if (isShow ||
|
|
2294
|
-
(!isShow && DOMUtilsCommonUtils.isShow(element))) {
|
|
2282
|
+
if (isShow || (!isShow && DOMUtilsCommonUtils.isShow(element))) {
|
|
2295
2283
|
/* 已显示 */
|
|
2296
2284
|
/* 不从style中获取对应的宽度,因为可能使用了class定义了width !important */
|
|
2297
2285
|
element = element;
|
|
@@ -2326,8 +2314,7 @@
|
|
|
2326
2314
|
height(element, isShow = false) {
|
|
2327
2315
|
let DOMUtilsContext = this;
|
|
2328
2316
|
if (DOMUtilsCommonUtils.isWin(element)) {
|
|
2329
|
-
return DOMUtilsContext.windowApi.window.document.documentElement
|
|
2330
|
-
.clientHeight;
|
|
2317
|
+
return DOMUtilsContext.windowApi.window.document.documentElement.clientHeight;
|
|
2331
2318
|
}
|
|
2332
2319
|
if (typeof element === "string") {
|
|
2333
2320
|
element = DOMUtilsContext.selector(element);
|
|
@@ -2341,8 +2328,7 @@
|
|
|
2341
2328
|
/* Document文档节点 */
|
|
2342
2329
|
return Math.max(element.body.scrollHeight, element.documentElement.scrollHeight, element.body.offsetHeight, element.documentElement.offsetHeight, element.documentElement.clientHeight);
|
|
2343
2330
|
}
|
|
2344
|
-
if (isShow ||
|
|
2345
|
-
(!isShow && DOMUtilsCommonUtils.isShow(element))) {
|
|
2331
|
+
if (isShow || (!isShow && DOMUtilsCommonUtils.isShow(element))) {
|
|
2346
2332
|
element = element;
|
|
2347
2333
|
/* 已显示 */
|
|
2348
2334
|
/* 从style中获取对应的高度,因为可能使用了class定义了width !important */
|
|
@@ -2470,8 +2456,7 @@
|
|
|
2470
2456
|
let to = {};
|
|
2471
2457
|
for (let prop in styles) {
|
|
2472
2458
|
from[prop] =
|
|
2473
|
-
element.style[prop] ||
|
|
2474
|
-
DOMUtilsContext.windowApi.globalThis.getComputedStyle(element)[prop];
|
|
2459
|
+
element.style[prop] || DOMUtilsContext.windowApi.globalThis.getComputedStyle(element)[prop];
|
|
2475
2460
|
to[prop] = styles[prop];
|
|
2476
2461
|
}
|
|
2477
2462
|
let timer = DOMUtilsCommonUtils.setInterval(function () {
|
|
@@ -2481,8 +2466,7 @@
|
|
|
2481
2466
|
progress = 1;
|
|
2482
2467
|
}
|
|
2483
2468
|
for (let prop in styles) {
|
|
2484
|
-
element.style[prop] =
|
|
2485
|
-
from[prop] + (to[prop] - from[prop]) * progress + "px";
|
|
2469
|
+
element.style[prop] = from[prop] + (to[prop] - from[prop]) * progress + "px";
|
|
2486
2470
|
}
|
|
2487
2471
|
if (progress === 1) {
|
|
2488
2472
|
DOMUtilsCommonUtils.clearInterval(timer);
|
|
@@ -2567,8 +2551,7 @@
|
|
|
2567
2551
|
if (element == null) {
|
|
2568
2552
|
return;
|
|
2569
2553
|
}
|
|
2570
|
-
return Array.from(element.parentElement
|
|
2571
|
-
.children).filter((child) => child !== element);
|
|
2554
|
+
return Array.from(element.parentElement.children).filter((child) => child !== element);
|
|
2572
2555
|
}
|
|
2573
2556
|
/**
|
|
2574
2557
|
* 获取当前元素的父元素
|
|
@@ -2644,14 +2627,7 @@
|
|
|
2644
2627
|
if (element.name &&
|
|
2645
2628
|
!element.disabled &&
|
|
2646
2629
|
(element.checked ||
|
|
2647
|
-
[
|
|
2648
|
-
"text",
|
|
2649
|
-
"hidden",
|
|
2650
|
-
"password",
|
|
2651
|
-
"textarea",
|
|
2652
|
-
"select-one",
|
|
2653
|
-
"select-multiple",
|
|
2654
|
-
].includes(element.type))) {
|
|
2630
|
+
["text", "hidden", "password", "textarea", "select-one", "select-multiple"].includes(element.type))) {
|
|
2655
2631
|
if (element.type === "select-multiple") {
|
|
2656
2632
|
for (let j = 0; j < element.options.length; j++) {
|
|
2657
2633
|
if (element.options[j].selected) {
|
|
@@ -2871,9 +2847,7 @@
|
|
|
2871
2847
|
});
|
|
2872
2848
|
return;
|
|
2873
2849
|
}
|
|
2874
|
-
if (DOMUtilsContext.windowApi.globalThis
|
|
2875
|
-
.getComputedStyle(element)
|
|
2876
|
-
.getPropertyValue("display") === "none") {
|
|
2850
|
+
if (DOMUtilsContext.windowApi.globalThis.getComputedStyle(element).getPropertyValue("display") === "none") {
|
|
2877
2851
|
DOMUtilsContext.show(element, checkVisiblie);
|
|
2878
2852
|
}
|
|
2879
2853
|
else {
|
|
@@ -2918,9 +2892,7 @@
|
|
|
2918
2892
|
selectionStart = Math.min($input.value.length, selectionStart);
|
|
2919
2893
|
if (typeof selectionEnd == "string")
|
|
2920
2894
|
selectionEnd = parseFloat(selectionEnd);
|
|
2921
|
-
if (typeof selectionEnd != "number" ||
|
|
2922
|
-
isNaN(selectionEnd) ||
|
|
2923
|
-
selectionEnd < selectionStart) {
|
|
2895
|
+
if (typeof selectionEnd != "number" || isNaN(selectionEnd) || selectionEnd < selectionStart) {
|
|
2924
2896
|
selectionEnd = selectionStart;
|
|
2925
2897
|
}
|
|
2926
2898
|
if (selectionEnd < 0)
|
|
@@ -3007,11 +2979,7 @@
|
|
|
3007
2979
|
var isBoxModel = $box.offsetWidth == 2;
|
|
3008
2980
|
body.removeChild($box);
|
|
3009
2981
|
let $boxRect = $input.getBoundingClientRect();
|
|
3010
|
-
var clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, scrollTop = win.pageYOffset ||
|
|
3011
|
-
(isBoxModel && docElem.scrollTop) ||
|
|
3012
|
-
body.scrollTop, scrollLeft = win.pageXOffset ||
|
|
3013
|
-
(isBoxModel && docElem.scrollLeft) ||
|
|
3014
|
-
body.scrollLeft;
|
|
2982
|
+
var clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, scrollTop = win.pageYOffset || (isBoxModel && docElem.scrollTop) || body.scrollTop, scrollLeft = win.pageXOffset || (isBoxModel && docElem.scrollLeft) || body.scrollLeft;
|
|
3015
2983
|
return {
|
|
3016
2984
|
top: $boxRect.top + scrollTop - clientTop,
|
|
3017
2985
|
left: $boxRect.left + scrollLeft - clientLeft,
|