npm.io
0.1.4 • Published 7 years ago

equalizeheight

Licence
ISC
Version
0.1.4
Deps
0
Size
12 kB
Vulns
0
Weekly
0

Equalize height

Equalize the height of elements on the same row, based on their offsetTop value. Most importantly, this also works for responsive layouts.

Installing

Using npm:

$ npm install equalizeheight

How to use

First, import the package into your project:

import 'equalizeheight';

To equalize the height of elements on the same row, you simply add a data-equalize-height attribute to those elements with a dedicated group name:

<div>
    <span data-equalize-height="group-name">Hello world!</span>
    <span data-equalize-height="group-name">Hello world!</span>
    <span data-equalize-height="group-name">Hello world!</span>
</div>

Just like that, all items on the same row with the same group name will be set to the same height. DONE!