I followed the documentation exactly, and the layout completion event does not work. An example can be seen here:
http://jsfiddle.net/9464buy5/
<div id="items">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
#items {
width: 500px;
}
.item {
background: #ff0000;
width: 200px;
height: 200px;
margin-bottom:20px;
}
$(document).ready(function() {
var $container = $('#items');
$container.masonry({
itemSelector: '.item',
columnWidth: 220,
gutter: 20
});
$container.masonry('on', 'layoutComplete', function(msnryInstance, laidOutItems) {
alert("");
});
});
Does anyone know if this is a known bug or did I do something wrong?
source
share