Commit a10e6c27 by Иван Кубота

D.getRect gets global element's offset

parent cf188ccc
...@@ -253,7 +253,14 @@ NS.apply = function(a,b) { ...@@ -253,7 +253,14 @@ NS.apply = function(a,b) {
return el; return el;
}; };
D.h = domEl; D.h = domEl;
D.getRect = function(el) {
var out = {left: el.offsetLeft, top: el.offsetTop, width: el.clientWidth, height: el.clientHeight}, pointer;
while((el = el.offsetParent)){
out.left += el.offsetLeft;
out.top += el.offsetTop;
}
return out;
};
D.ext = function(el, cfg) { D.ext = function(el, cfg) {
cfg.el = el; cfg.el = el;
if(cfg.cls){ if(cfg.cls){
......
{ {
"name": "react-vanilla", "name": "react-vanilla",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"main": "DOM.js", "main": "DOM.js",
"scripts": { "scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment