diff options
author | liabru <liabru@brm.io> | 2015-10-17 19:27:35 +0100 |
---|---|---|
committer | liabru <liabru@brm.io> | 2015-10-17 19:27:35 +0100 |
commit | 89b74a7bbcc65504056cbb9bc952bbbd11e612f0 (patch) | |
tree | 6343f9e874d8e839b9695695f630f389a54c4a16 | |
parent | a7d35dca8b452d29c6183ca7a01e9da846f90cf2 (diff) | |
parent | 8844acb9fea5e734ba10ef365091eee01e3c2be9 (diff) | |
download | jquery-match-height-89b74a7bbcc65504056cbb9bc952bbbd11e612f0.zip jquery-match-height-89b74a7bbcc65504056cbb9bc952bbbd11e612f0.tar.gz jquery-match-height-89b74a7bbcc65504056cbb9bc952bbbd11e612f0.tar.bz2 |
Merge branch 'floatingcontents' of https://github.com/jorrit/jquery-match-height into jorrit-floatingcontents
Conflicts:
jquery.matchHeight.js
-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 99310c3..f4ab786 100644 --- a/jquery.matchHeight.js +++ b/jquery.matchHeight.js @@ -188,7 +188,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 98f40f5..882abe5 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 2fd816f..7f290e0 100644 --- a/test/specs/matchHeight.spec.js +++ b/test/specs/matchHeight.spec.js @@ -84,7 +84,7 @@ describe('matchHeight', function() { it('has matched heights when byRow true', function(done) { $('.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); @@ -125,7 +125,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(), |