summaryrefslogtreecommitdiffstats
path: root/jquery.matchHeight.js
diff options
context:
space:
mode:
authorliabru <liabru@brm.io>2014-08-03 13:58:05 +0100
committerliabru <liabru@brm.io>2014-08-03 13:58:05 +0100
commitb3df801b4144b295ee4eeb42ae10c45dc5b958d6 (patch)
tree78767e2ae2df60ad8954493807ac18f8f1bda1a1 /jquery.matchHeight.js
parent5dafa0c7b5aab768dd17f312b766b1d55aadf06a (diff)
downloadjquery-match-height-b3df801b4144b295ee4eeb42ae10c45dc5b958d6.zip
jquery-match-height-b3df801b4144b295ee4eeb42ae10c45dc5b958d6.tar.gz
jquery-match-height-b3df801b4144b295ee4eeb42ae10c45dc5b958d6.tar.bz2
fixed support for inline-block
Diffstat (limited to 'jquery.matchHeight.js')
-rw-r--r--jquery.matchHeight.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/jquery.matchHeight.js b/jquery.matchHeight.js
index 367df93..713f70f 100644
--- a/jquery.matchHeight.js
+++ b/jquery.matchHeight.js
@@ -51,13 +51,18 @@
if (byRow) {
// must first force an arbitrary equal height so floating elements break evenly
- $elements.css({
- 'display': 'block',
- 'padding-top': '0',
- 'padding-bottom': '0',
- 'border-top-width': '0',
- 'border-bottom-width': '0',
- 'height': '100px'
+ $elements.each(function() {
+ var $that = $(this),
+ display = $that.css('display') === 'inline-block' ? 'inline-block' : 'block';
+
+ $that.css({
+ 'display': display,
+ 'padding-top': '0',
+ 'padding-bottom': '0',
+ 'border-top-width': '0',
+ 'border-bottom-width': '0',
+ 'height': '100px'
+ });
});
// get the array of rows (based on element top position)
@@ -84,10 +89,11 @@
// iterate the row and find the max height
$row.each(function(){
- var $that = $(this);
+ var $that = $(this),
+ display = $that.css('display') === 'inline-block' ? 'inline-block' : 'block';
// ensure we get the correct actual height (and not a previously set height value)
- $that.css({ 'display': 'block', 'height': '' });
+ $that.css({ 'display': display, 'height': '' });
// find the max height (including padding, but not margin)
if ($that.outerHeight(false) > maxHeight)