| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 // $Id: jquery.equalheights.js,v 1.1.2.1 2010/02/14 06:44:15 sociotech Exp $ 2 3 /** 4 * Equal Heights Plugin 5 * Equalize the heights of elements. Great for columns or any elements 6 * that need to be the same size (floats, etc). 7 * 8 * Version 1.0 9 * Updated 12/10/2008 10 * 11 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 12 * 13 * Usage: $(object).equalHeights([minHeight], [maxHeight]); 14 * 15 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height. 16 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall. 17 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more 18 * than 300 pixels tall. Elements with too much content will gain a scrollbar. 19 * 20 */ 21 22 (function($) { 23 $.fn.equalHeights = function(minHeight, maxHeight) { 24 tallest = (minHeight) ? minHeight : 0; 25 this.each(function() { 26 if($(this).height() > tallest) { 27 tallest = $(this).height(); 28 } 29 }); 30 if((maxHeight) && tallest > maxHeight) tallest = maxHeight; 31 return this.each(function() { 32 $(this).height(tallest).css("overflow","visible"); 33 }); 34 }; 35 })(jQuery);
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |