0.2kb Equal Height Plugin In jQuery - Uniform

0.2kb Equal Height Plugin In jQuery - Uniform
File Size: 3.55 KB
Views Total: 311
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Uniform is a dead simple and extremely lightweight (~191 bytes minified) jQuery plugin to create equal height columns without any JS call.

The plugin finds the tallest elements in your layout and then applies the tallest height to the other elements with the data-uniform="true" attribute.

See Also:

How to use it:

1. Download and include the Uniform plugin's script after the latest jQuery JavaScript library.

<!-- IE 9+ -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" 
        integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" 
        crossorigin="anonymous">
</script>
<!-- IE 8 -->
<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<!-- Minified JS -->
<script src="uniform.min.js"></script>

2. Add the data-uniform="true" attribute to your layout items and the plugin will do the rest.

<div class="container">

    <div class="col" data-uniform="true">
      <p>A asperiores autem corporis culpa dolore dolorem dolores est ex facilis fuga hic laborum laudantium magnam nisi obcaecati possimus quibusdam quos rerum sed sit totam unde veritatis voluptatem, voluptates voluptatum.</p>
    </div>

    <div class="col" data-uniform="true">
      <p>A asperiores autem corporis culpa dolore dolorem dolores est ex facilis fuga hic laborum laudantium magnam nisi obcaecati possimus quibusdam quos rerum sed sit totam unde veritatis voluptatem, voluptates voluptatum.</p>
    </div>

    <div class="col" data-uniform="true">
      <p>A asperiores autem corporis culpa dolore dolorem dolores est ex facilis fuga hic laborum laudantium magnam nisi obcaecati possimus quibusdam quos rerum sed sit totam unde veritatis voluptatem, voluptates voluptatum.</p>
    </div>

    ...

</div>

This awesome jQuery plugin is developed by genericmilk. For more Advanced Usages, please check the demo page or visit the official website.