Submit your widget

EqualHeight.js - A jQuery plugin that sets the height of each element in a group to the height of the highest element

Created 6 years ago   Views 8395   downloads 1860    Author JorenVanHee
EqualHeight.js - A jQuery plugin that sets the height of each element in a group to the height of the highest element
View DemoDownload
49
Share |

A jQuery plugin that sets the height of each element in a group to the height of the highest element.
It is responsive, so it keeps working when you resize your window.

Usage

  1. Include jQuery:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    
  2. Include plugin's code:

    <script src="dist/jquery.equalheight.min.js"></script>
    
  3. Call the plugin:

    $(document).ready(function () {
        $('.elements').equalHeight();
    }
    

Options

option type default description
wait boolean false If true, the plugin will wait to do its work until you start the plugin manually. Take a look at the advanced example.
responsive boolean true Adjusts height of elements when necessary (if you resize your window).
$('.elements').equalHeight({
    wait: false,
    responsive: true
});

Methods

Take a look at the advanced example.

method description
start Start the plugin.
stop Stop the plugin and reset the elements.
magic Set the height of each element to the height of the highest element.
reset Remove all styles added by this plugin.
var eh = $('.elements').equalHeight();
eh.method();

Credits

jQuery Boilerplate

License

The MIT License (MIT)