Commit 13a682a2c79d9aaad8a8efede1adb61fb6a7006b
1 parent
30670d57
Exists in
master
and in
5 other branches
small improvments on equalHeights cals
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
js/jquery.equalHeights.js
@@ -5,12 +5,12 @@ $.fn.equalHeights = function(px) { | @@ -5,12 +5,12 @@ $.fn.equalHeights = function(px) { | ||
5 | $(this).each(function(index, item){ | 5 | $(this).each(function(index, item){ |
6 | var $item = $(item); | 6 | var $item = $(item); |
7 | $item.height('auto'); // force a 'recalc' height | 7 | $item.height('auto'); // force a 'recalc' height |
8 | - | ||
9 | - if ($item.height() > currentTallest) { currentTallest = $item.height(); } | 8 | + var h = $item.height(); |
9 | + if ( h > currentTallest) { currentTallest = h; } | ||
10 | if (!px && Number.prototype.pxToEm) { currentTallest = currentTallest.pxToEm(); } //use ems unless px is specified | 10 | if (!px && Number.prototype.pxToEm) { currentTallest = currentTallest.pxToEm(); } //use ems unless px is specified |
11 | // for ie6, set height since min-height isn't supported | 11 | // for ie6, set height since min-height isn't supported |
12 | if (typeof(document.body.style.minHeight) === 'undefined') { $item.css({'height': currentTallest}); } | 12 | if (typeof(document.body.style.minHeight) === 'undefined') { $item.css({'height': currentTallest}); } |
13 | - $item.css({'height': currentTallest}); | 13 | + $item.height(currentTallest); |
14 | }); | 14 | }); |
15 | return this; | 15 | return this; |
16 | }; | 16 | }; |