domvertices
v0.0.2
Published
Compute 4 vertices absolute coordinates from any DOM element.
Readme
Compute the 4 vertices a,b,c,d absolute coordinates of any, deep, transformed, positioned DOM element.
a b
+--------------+
| |
| el |
| |
+--------------+
d cUsage
var el = document.getElementById('foo');
var v = domvertices(el);
console.log(v);outputs:
{
a: {x: , y: , z: },
b: {x: , y: , z: },
c: {x: , y: , z: },
d: {x: , y: , z: }
}jQuery plugin
var $el = $('#foo');
var v = $el.domvertices();
console.log(v);you can also trace vertices for debug purpose:
v.update().trace();or remove the trace:
v.erase();