vanilla-js-match-height
v1.0.7
Published
A jQuery free equivilent of jQuery match height, a simple, lightweight way to make elements the same height.
Downloads
1,491
Maintainers
Readme
Contents
Install
- Install the package.
npm install vanilla-js-match-height
- Import the package into your application script.
import MatchHeight from 'vanilla-js-match-height';
Or include the script in your HTML.
<script async src="vanilla-js-match-height/dist/index.js"></script>
How To Use
( Basic usage )
import MatchHeight from 'vanilla-js-match-height';
// New MatchHeight - The only required parameter
// is the element class at the start. The second parameter
// is an optional object for the settings. The 3 settings
// that can be passed into this object are, parent, byRow
// and timeOut.
new MatchHeight(Element, Options);
// Full Example of the format
new MatchHeight('.my-class',
{
parent: '.my-parent', // A parent class or ID to group items ( Default value : null )
byRow: true, // Use the elemnt offset to group them by row ( Default value : true )
timeOut: 300 // Sets A Timout On Load mainly for sliders ( Default value : 50 )
}
);
Out of the box Vanilla JS Match Height will update on resize and will recalculate the rows on resize too.
Examples
See the Docs for the full list of options.
Author
Josh Donnell
Support
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!