element-height-observer
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "element-height-observer", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Allows you to add an efficient height listener to any dom element and execute a callback when its height changes", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.min.js", |
@@ -15,5 +15,26 @@ # Element height observer | ||
When the page has loaded, you can register the oberver like this: | ||
Load the script: | ||
```html | ||
<html> | ||
<head> | ||
<script src="node_modules/element-height-observer/dist/index.js"></script> | ||
</head> | ||
</html> | ||
``` | ||
Or import it: | ||
```javascript | ||
var heightObserver = require('element-height-observer'); | ||
var registerHeightObserver = heightObserver.registerHeightObserver; | ||
var unregisterHeightObserver = heightObserver.unregisterHeightObserver; | ||
``` | ||
Or import it (ES6 modules notation): | ||
```javascript | ||
import { registerHeightObserver, unregisterHeightObserver } from 'element-height-observer'; | ||
``` | ||
When the page has loaded, you can register the observer like this: | ||
```javascript | ||
window.addEventListener('load', function () { | ||
@@ -20,0 +41,0 @@ var someElement = document.querySelector('#someElementId'); |
Sorry, the diff of this file is not supported yet
56
56818