npm.io
1.0.1 • Published 9 years ago

fit-parent-to-child

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:

  1. parentSelector: Any valid CSS selector.
  2. childSelector: Any valid CSS selector. If the child is not inside the parent, nothing will happen.