Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/status201/jquery-equalheights

Equal heights jQuery Plugin
https://github.com/status201/jquery-equalheights

javascript jquery jquery-plugin vertical-align

Last synced: 16 days ago
JSON representation

Equal heights jQuery Plugin

Awesome Lists containing this project

README

        

# jquery-equalheights
Equal heights jQuery Plugin by Gijs Oliemans, Status201 [Web Development](http://status201.nl)

## What does it do?
Little jQuery plugin to "vertically align elements" by stretching their height to match the tallest.
Only elements that live exactly at the same height in the document will be maximised to the same height.
This way 2 rows can vertically align nicely while having different heights.

## Install
Download either the [production version](https://github.com/status201/jquery-equalheights/blob/master/jquery.equalheights.min.js) or the [development version](https://github.com/status201/jquery-equalheights/blob/master/jquery.equalheights.js) of jquery-equalheights.

In your web page:
```html

$( document ).ready(function() {
$('.elements-with-different-heights').equalHeights();
});

```

## Bower
To install jquery-equalheights via Bower:
```
bower install jquery-equal-heights
```

## Options
| Option | Possible values | Default |
| :------------ |:---------------:| -------:|
| onLoad | true / false | true |
| onResize | true / false | true |

## Examples
```javascript
$( document ).ready(function() {

// make all list items with class category the same height
$('li.category').equalHeights();

// make different elements the same height
$('p.intro, img.thumbnail').equalHeights();

// only resize once now (not on window.resize and window.load)
$('.nav button').equalHeights({
onResize: false,
onLoad: false
});
});
```

## More info
More info at: http://dev201.nl/equal-height-jquery-plugin/