├── .semver ├── composer.json ├── bower.json ├── CHANGELOG.md ├── jquery.equalHeights.min.js ├── jquery.equalHeights.js ├── LICENSE └── README.md /.semver: -------------------------------------------------------------------------------- 1 | --- 2 | :major: 1 3 | :minor: 2 4 | :patch: 2 5 | :special: '' 6 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "cviebrock/jquery-equalheights", 3 | "description" : "Equalize heights of containers via jQuery, with additional options.", 4 | "license" : "MIT", 5 | "authors": [ 6 | { 7 | "name" : "Colin Viebrock", 8 | "email" : "colin@viebrock.ca" 9 | }, 10 | { 11 | "name" : "Rob Glazebrook", 12 | "website" : "http://www.cssnewbie.com/equalheights-jquery-plugin/" 13 | } 14 | ] 15 | 16 | } 17 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-equalheights", 3 | "description": "Equalize heights of containers via jQuery, with additional options.", 4 | "version": "1.2.2", 5 | "repository": { 6 | "type": "git", 7 | "url": "git@github.com:cviebrock/jquery-equalheights.git" 8 | }, 9 | "dependencies": { 10 | "jquery": ">=1.9 <2.0.0" 11 | }, 12 | "main": "jquery.equalHeights.js", 13 | "homepage": "https://github.com/cviebrock/jquery-equalheights", 14 | "ignore": [ 15 | ".semver", 16 | "build.sh" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Version 1.2.2 - 01-May-2014 4 | 5 | - fix version number in `bower.json` 6 | 7 | 8 | ## Version 1.2.1 - 29-Apr-2014 9 | 10 | - fix `bower.json` to ignore some files on build 11 | 12 | 13 | ## Version 1.2.0 - 29-Apr-2014 14 | 15 | - allow jQuery versions >=1.9 but <2.0.0 (thanks @geoffharcourt) 16 | 17 | 18 | ## Version 1.1.0 - 24-Sep-2013 19 | 20 | - added `bower.json` and fixed up packaging 21 | 22 | 23 | ## Version 1.0.1 - 13-Feb-2013 24 | 25 | - fix typo in `composer.json` 26 | 27 | 28 | ## Version 1.0.0 - 04-Feb-2013 29 | 30 | - Initial release 31 | -------------------------------------------------------------------------------- /jquery.equalHeights.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery-equalheights 3 | * https://github.com/cviebrock/jquery-equalheights 4 | * Colin Viebrock 5 | */ 6 | (function($){$.fn.equalHeights=function(options){var defaults={minHeight:0,maxHeight:false,overflow:"auto",extra:0};var options=$.extend(defaults,options);var tallest=options.minHeight?options.minHeight:0;this.each(function(){var h=$(this).height();if(h>tallest){tallest=h}});if(options.maxHeight&&tallest>options.maxHeight){tallest=options.maxHeight}tallest+=options.extra;return this.each(function(){$(this).height(tallest).css("overflow",options.overflow)})}})(jQuery); -------------------------------------------------------------------------------- /jquery.equalHeights.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery-equalheights 3 | * https://github.com/cviebrock/jquery-equalheights 4 | * Colin Viebrock 5 | */ 6 | 7 | (function($) { 8 | $.fn.equalHeights = function(options) { 9 | 10 | var defaults = { 11 | minHeight : 0, 12 | maxHeight : false, 13 | overflow : 'auto', 14 | extra : 0 15 | }; 16 | 17 | var options = $.extend(defaults, options); 18 | 19 | 20 | var tallest = (options.minHeight) ? options.minHeight : 0; 21 | this.each(function() { 22 | var h = $(this).height(); 23 | if( h > tallest) { 24 | tallest = h; 25 | } 26 | }); 27 | if((options.maxHeight) && tallest > options.maxHeight) { 28 | tallest = options.maxHeight; 29 | } 30 | tallest += options.extra; 31 | return this.each(function() { 32 | $(this).height(tallest).css('overflow',options.overflow); 33 | }); 34 | } 35 | })(jQuery); 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Colin Viebrock 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jquery-equalHeights 2 | 3 | Equalize heights of containers via jQuery, with additional options. 4 | 5 | [![Bower version](https://badge.fury.io/bo/jquery-equalheights.svg)](http://badge.fury.io/bo/jquery-equalheights) 6 | 7 | ## Install with Bower 8 | 9 | ``` 10 | bower install jquery-equalheights 11 | ``` 12 | 13 | 14 | ## Usage 15 | 16 | ```js 17 | $(objects).equalHeights([options]); 18 | ``` 19 | 20 | 21 | ## Options 22 | 23 | * minHeight - sets all selections to at least the given height (default 0) 24 | * maxHeight - all selections are no more than the given height (no default) 25 | * overflow - CSS overflow value to apply to selections (default "auto") 26 | * extra - additional height to add to each element (default 0) 27 | 28 | 29 | ## Dynamic Content 30 | 31 | Because this plug-in sets the height of all the passed objects, if the content of those objects later changes, the heights may need to be recalculated. In this case, just call the function again. 32 | 33 | 34 | ## Credits 35 | 36 | This code is largely based on the work of Rob Glazebrook and his code at . 37 | 38 | I've added the ability to pass some additional options to Rob's code, and cleaned some stuff up as it relates to current versions of jQuery. 39 | --------------------------------------------------------------------------------