EqualStature matches the height of elements using the tallest (natural) height
- Equal (adj)
- Having the same mathematical value
- Stature (noun)
- A person's natural height
This small plugin was mearly created as a dab into creating jQuery plugins as well as just wanting a quick, easy and small bit of code to sort out some content block heights. It is in no way perfect and if you want something a little more robust try something else (which may be a bit bulkier). Feel free to create a pull request if there are any improvements you can make and let me know of any issues.
EqualStature uses the elements children (where possible) to find out the natural height of each element. It will then get the max height of all those elements and resize them all to be equal heights.
// Initialise the plugin
$(document).ready(function(){
$('.elements').equalStature();
});
// Calculate heights on window resize
$(window).resize(function(){
$('.elements').equalStature();
});
// Destroy the plugin
$('.elements').equalStature('destroy');
The plugin uses min-height, allowing to grow in size if necessary. The destroy flag is just used as a quick way to reset min-height if need be.
EqualStature requires jQuery 1.4 or higher (needs testing).
EqualSature is released under the MIT License.