Skip to content

aihowes/equalstature

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EqualStature

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

Another Equal Heights Plugin... Seriously?

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.

How To Use It

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.

Dependencies

EqualStature requires jQuery 1.4 or higher (needs testing).

License

EqualSature is released under the MIT License.

Author

Alex Howes - @aihowes

About

EqualStature a jQuery plugin that matches the height of elements using the tallest (natural) height

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published