@livelybone/scroll-get
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -0,1 +1,9 @@ | ||
/** | ||
* Bundle of @livelybone/scroll-get | ||
* Generated: 2018-12-25 | ||
* Version: 3.2.0 | ||
* License: MIT | ||
* Author: livelybone(2631541504@qq.com) | ||
*/ | ||
function getRect(el) { | ||
@@ -16,12 +24,6 @@ return el.getBoundingClientRect() | ||
function posRelativeToClient(el) { | ||
var o = { clientLeft: 0, clientTop: 0 }; | ||
while (el) { | ||
var rect = getRect(el); | ||
o.clientLeft += rect.left; | ||
o.clientTop += rect.top; | ||
el = el.offsetParent; | ||
} | ||
return o | ||
var rect = getRect(el); | ||
return { clientLeft: rect.left, clientTop: rect.top } | ||
} | ||
export { getRect, posRelativeToPage, posRelativeToClient }; |
@@ -1,1 +0,9 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ScrollGet={})}(this,function(e){"use strict";function n(e){return e.getBoundingClientRect()}e.getRect=n,e.posRelativeToPage=function(e){for(var t={pageLeft:0,pageTop:0};e;)t.pageLeft+=e.offsetLeft,t.pageTop+=e.offsetTop,e=e.offsetParent;return t},e.posRelativeToClient=function(e){for(var t={clientLeft:0,clientTop:0};e;){var o=n(e);t.clientLeft+=o.left,t.clientTop+=o.top,e=e.offsetParent}return t},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
/** | ||
* Bundle of @livelybone/scroll-get | ||
* Generated: 2018-12-25 | ||
* Version: 3.2.0 | ||
* License: MIT | ||
* Author: livelybone(2631541504@qq.com) | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ScrollGet={})}(this,function(e){"use strict";function o(e){return e.getBoundingClientRect()}e.getRect=o,e.posRelativeToPage=function(e){for(var t={pageLeft:0,pageTop:0};e;)t.pageLeft+=e.offsetLeft,t.pageTop+=e.offsetTop,e=e.offsetParent;return t},e.posRelativeToClient=function(e){var t=o(e);return{clientLeft:t.left,clientTop:t.top}},Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "@livelybone/scroll-get", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "A module for get left/top distance to client or page of element", | ||
@@ -34,4 +34,5 @@ "main": "./lib/umd/index.js", | ||
"rollup": "^0.65.1", | ||
"rollup-plugin-license": "^0.7.0", | ||
"rollup-plugin-uglify": "^5.0.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5118
34
5