diff options
author | liabru <liabru@brm.io> | 2015-11-08 18:16:38 +0000 |
---|---|---|
committer | liabru <liabru@brm.io> | 2015-11-08 18:16:38 +0000 |
commit | dc9716b0385ea1c20bd81b7ca84e82f6caa92cd1 (patch) | |
tree | 54d8e4769c3db1c65dd3d5abf76734300b1748e8 | |
parent | 431e4d0eb332a4d34440116e76563abd7104e660 (diff) | |
parent | 89b74a7bbcc65504056cbb9bc952bbbd11e612f0 (diff) | |
download | jquery-match-height-dc9716b0385ea1c20bd81b7ca84e82f6caa92cd1.zip jquery-match-height-dc9716b0385ea1c20bd81b7ca84e82f6caa92cd1.tar.gz jquery-match-height-dc9716b0385ea1c20bd81b7ca84e82f6caa92cd1.tar.bz2 |
Merge branch 'jorrit-floatingcontents'
-rw-r--r-- | jquery.matchHeight.js | 3 | ||||
-rw-r--r-- | test/page/test.css | 16 | ||||
-rw-r--r-- | test/page/test.html | 27 | ||||
-rw-r--r-- | test/specs/matchHeight.spec.js | 4 |
4 files changed, 47 insertions, 3 deletions
diff --git a/jquery.matchHeight.js b/jquery.matchHeight.js index 2034082..18a75cf 100644 --- a/jquery.matchHeight.js +++ b/jquery.matchHeight.js @@ -191,7 +191,8 @@ 'margin-bottom': '0', 'border-top-width': '0', 'border-bottom-width': '0', - 'height': '100px' + 'height': '100px', + 'overflow': 'hidden' }); }); diff --git a/test/page/test.css b/test/page/test.css index eb40559..851c12c 100644 --- a/test/page/test.css +++ b/test/page/test.css @@ -304,4 +304,20 @@ a.test-summary.has-failed { display: inline-flex; vertical-align: top; float: none; +} + +/* test items-with-float */ + +.items-with-float .item-0 { + float: none; + width: auto; +} + +.items-with-float .item-0 .float-element { + display: inline-block; + float: left; + width: 150px; + height: 150px; + margin: 0 20px 12px 0; + background: #EB6841; }
\ No newline at end of file diff --git a/test/page/test.html b/test/page/test.html index 05de93a..244923f 100644 --- a/test/page/test.html +++ b/test/page/test.html @@ -345,6 +345,33 @@ </div> </div> </div> + + <div class="items-container items-with-float"> + <div class="item item-0"> + <div class="float-element"></div> + <h3>Floating element</h3> + <p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam.</p> + <p>Aenean semper felis ipsum, vulputate consequat dui elementum vel.</p> + <p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam. Nunc sollicitudin felis ut pellentesque fermentum. In erat mi, pulvinar sit amet tincidunt vitae, gravida id felis. Phasellus hendrerit erat sed porta imperdiet. Vivamus viverra ipsum tortor, et congue mauris porttitor ut.</p> + <p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam. Nunc sollicitudin felis ut pellentesque fermentum. In erat mi, pulvinar sit amet tincidunt vitae, gravida id felis.</p> + </div> + <div class="item item-1"> + <h3>Lorem ipsum dolor</h3> + <p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam. Nunc sollicitudin felis ut pellentesque fermentum. In erat mi, pulvinar sit amet tincidunt vitae, gravida id felis.</p> + </div> + <div class="item item-2"> + <h3>Lorem ipsum dolor</h3> + <p>Aenean semper felis ipsum, vulputate consequat dui elementum vel.</p> + </div> + <div class="item item-3"> + <h3>Lorem ipsum dolor</h3> + <p>Aenean semper felis ipsum, vulputate consequat dui elementum vel. Nullam odio eros, sagittis vitae lectus id, pretium viverra lectus. Etiam auctor dolor non dui ultricies pulvinar.</p> + </div> + <div class="item item-4"> + <h3>Lorem ipsum dolor</h3> + <p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam.</p> + </div> + </div> </div> <div id='results'></div> </body> diff --git a/test/specs/matchHeight.spec.js b/test/specs/matchHeight.spec.js index edbe575..c7e4fd8 100644 --- a/test/specs/matchHeight.spec.js +++ b/test/specs/matchHeight.spec.js @@ -106,7 +106,7 @@ describe('matchHeight', function() { expect(1.0001).not.toBeWithinTolerance(0); $('.simple-items, .image-items, .nested-items-parent, .nested-items,' + - '.fixed-items, .inline-block-items, .inline-flex-items') + '.fixed-items, .inline-block-items, .inline-flex-items, .items-with-float') .each(function() { var $items = $(this).children('.item'), rows = $.fn.matchHeight._rows($items); @@ -147,7 +147,7 @@ describe('matchHeight', function() { $.fn.matchHeight._update(); $('.simple-items, .image-items,' + - '.fixed-items, .inline-block-items, .inline-flex-items') + '.fixed-items, .inline-block-items, .inline-flex-items, .items-with-float') .each(function() { var $items = $(this).children('.item'), targetHeight = $items.first().outerHeight(), |