Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robbestad/dom-find

Utils for finding DOM elements. Used by react-stickydiv
https://github.com/robbestad/dom-find

Last synced: 20 days ago
JSON representation

Utils for finding DOM elements. Used by react-stickydiv

Awesome Lists containing this project

README

        

# Find DOM utils

Utils for finding DOM elements. Used by [react-stickydiv][1]

```js
var util = require('dom-find');

// util.findPos(document.getElementById("element"));
// [0,100]

// util.findPosRelativeToViewport(document.getElementById("element"));
// [50,-200]

```

You can also use this with React

```js
var util = require('dom-find');

// util.findPos(React.findDOMNode());
// [0,100]

// util.findPosRelativeToViewport(React.findDOMNode());
// [50,-200]

```

[1]: https://github.com/svenanders/react-stickydiv