element-position
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Position=e()}(this,function(){"use strict";return{getNestedOffset:function(t){for(var e=t.offsetLeft,f=t.offsetTop,o=t.offsetLeft+t.offsetWidth,s=t.offsetTop+t.offsetHeight;t=t.offsetParent;)e+=t.offsetLeft,f+=t.offsetTop,o+=t.offsetLeft,s+=t.offsetTop;return{left:e,top:f,right:o,bottom:s}},getNestedScroll:function(t){for(var e=0,f=0;t=t.parentElement;)e+=t.scrollLeft,f+=t.scrollTop;return{x:e,y:f}},getAbsolute:function(t){var e=this.getNestedOffset(t),f=this.getNestedScroll(t);return{left:e.left-f.x,top:e.top-f.y,right:e.right-f.x,bottom:e.bottom-f.y}}}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Position=e()}(this,function(){"use strict";function o(t){for(var e=t.offsetLeft,f=t.offsetTop,o=t.offsetLeft+t.offsetWidth,n=t.offsetTop+t.offsetHeight;t=t.offsetParent;)e+=t.offsetLeft,f+=t.offsetTop,o+=t.offsetLeft,n+=t.offsetTop;return{left:e,top:f,right:o,bottom:n}}function n(t){for(var e=0,f=0;t=t.parentElement;)e+=t.scrollLeft,f+=t.scrollTop;return{x:e,y:f}}return{getNestedOffset:o,getNestedScroll:n,getAbsolute:function(t){var e=o(t),f=n(t);return{left:e.left-f.x,top:e.top-f.y,right:e.right-f.x,bottom:e.bottom-f.y}}}}); |
{ | ||
"name": "element-position", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Calculates the position of the DOM.", | ||
@@ -25,3 +25,3 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"rollup": "rollup --config rollup.config.js" | ||
"build": "rollup --config rollup.config.js" | ||
}, | ||
@@ -28,0 +28,0 @@ "license": "MIT", |
2718