Licence
ISC
Version
1.0.1
Deps
2
Vulns
0
Weekly
0
Dynamically set the height of an HTML element to that of a child element.
Installation
npm install --save fit-parent-to-child
Usage
import fitParentToChild from 'fit-parent-to-child';
window.addEventListener('load', () => fitParentToChild({
parentSelector: '.parentElement',
childSelector: '.childSelector'
}));
The Settings Object.
The fitParentToChild function takes a single object with two required parameters:
parentSelector: Any valid CSS selector.childSelector: Any valid CSS selector. If the child is not inside the parent, nothing will happen.