domvertices

0.0.2 • Public • Published

Compute the 4 vertices a,b,c,d absolute coordinates of any, deep, transformed, positioned DOM element.

a                b
 +--------------+
 |              |
 |      el      |
 |              |
 +--------------+
d                c

Usage

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();

Readme

Keywords

none

Package Sidebar

Install

npm i domvertices

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

19.3 kB

Total Files

6

Last publish

Collaborators

  • abernier