我在将砌体与 Foundation 网格布局集成时遇到问题。基本上对于具有不同高度的相同宽度的图像,砌体按预期工作,但在某些断点处,网格将只有两列布局,而不是通常的四列布局。
但是,如果您继续最小化浏览器宽度,则四列会返回,因此不可能没有空间来显示它们。
var $container = $('#work_grid');
$container.imagesLoaded( function(){
$('#work_grid').masonry({
itemSelector: '.work_item',
isAnimated: true,
});
HTML
<div class="row">
<div class="twelve columns">
<div id="work_grid" class="block-grid four-up">
<li class="work_item"><img src="stylesheets/images/work1.jpg" alt=""></li>
<li class="work_item"><img src="stylesheets/images/work2.jpg" alt=""></li>
<li class="work_item"><img src="stylesheets/images/work3.jpg" alt=""></li>
<li class="work_item"><img src="stylesheets/images/work4.jpg" alt=""></li>
<li class="work_item"><img src="stylesheets/images/work5.jpg" alt=""></li>
<li class="work_item"><img src="stylesheets/images/work6.jpg" alt=""></li>
<li class="work_item"><img src="stylesheets/images/work7.jpg" alt=""></li>
</div> <!-- /.block-grid four-up -->
</div> <!-- /.twelve columns -->
</div> <!-- /.row -->