npm.io
1.0.7 • Published 7 years ago

js-match-height

Licence
ISC
Version
1.0.7
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
9

js-match-height

Dependency-free vanilla js plugin to match element heights, in a tiny file (2kb).

Getting Started

npm i js-match-height --save

Use

Import the library and simply instatiate with your elements, no options required. MatchHeight will correct heights if needed on window resize, using a debounce method to improve performance.

import { MatchHeight } from 'js-match-height';

Pass your elements.

const matchHeight = new MatchHeight('ul.list-items  li');

The timeout for the debounce method is defaulted at 250. You can set your time if needed.

const matchHeight = new MatchHeight('ul.list-items  li', { timeout:400 });

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • jquery match height

Keywords