I\'ve found this template that demonstrates the issue I\'m having with jquery masonry and image layout. Take a look at this twitter bootstrap template page:
The very fi
Use imagesLoaded() to triggered masonry after all images are loaded.
(imagesLoaded()
is provided by the script http://github.com/desandro/imagesloaded.)
$('.gallery-masonry').imagesLoaded( function(){
$('.gallery-masonry').masonry({
itemSelector: '.item',
isAnimated: true,
isFitWidth: true
});
});
The accepted answer has missing steps. So here is a step-by-step.
```[Adjust path to your javascript files]
<script src="/js/masonry.pkgd.min.js"></script>
<script src="/js/imagesloaded.pkgd.min.js"></script>
<script>
$('.gallery-masonry').imagesLoaded( function(){
$('.gallery-masonry').masonry({
itemSelector: '.item',
isAnimated: true,
isFitWidth: true
});
});
</script>