fit-parent-to-child
v1.0.1
Published
Force a specified HTML element to have the same height as a child element.
Downloads
20
Readme
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.