I've downloaded the latest version of masonry and copied the instructions from the website, but masonry doesn't appear to be loading on my site. The images are floated next to each other, but they aren't lined up correctly. Here is my code.
JS
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/masonry-docs/masonry.pkgd.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/masonry-docs/masonry.pkgd.min.js"></script>
<script>
$(document).ready(function(){
$("#grid").masonry({
itemSelector: '.grid-item',
columnWidth: 310;
}).imagesLoaded(function() {
$('#grid').masonry('reload');
});
</script>
CSS
div#grid {
margin: 0 auto;
overflow: hidden;
width: 95%;
}
div.grid-item {
display: block;
float: left;
margin: 5px;
width: 300px;
}
div.grid-item img {
width: 300px;
}
HTML
<div id="grid">
<div class="grid-item"><img src="example1" /></div>
<div class="grid-item"><img src="example2" /></div>
</div>
Edit: this is what my page looks like. https://i.stack.imgur.com/eEaWL.jpg