Fix some image glitches while not all images are loaded.

This commit is contained in:
Aaron Mueller 2014-03-26 20:18:43 +01:00
parent 248ff5a88f
commit 3c310e3460
2 changed files with 8 additions and 5 deletions

View file

@ -1,8 +1,10 @@
$(function() {
$('#covers').masonry({
columnWidth: 265,
gutter: 5,
isFitWidth: true,
itemSelector: '.cover-item'
$('#covers').imagesLoaded(function() {
$('#covers').masonry({
columnWidth: 265,
gutter: 5,
isFitWidth: true,
itemSelector: '.cover-item'
});
});
});

View file

@ -6,6 +6,7 @@
<link rel="stylesheet" href="styles.css">
<script src="vendors/jquery-2.1.0.min.js"></script>
<script src="vendors/masonry-3.1.5.pkgd.min.js"></script>
<script src="vendors/imagesloaded-3.1.4.pkgd.min.js"></script>
<script src="main.js"></script>
</head>
<body>