$(function () {
var $boxes = $('.loop');
var $container = $('#content_masonry');
$container.imagesLoaded( function() {
$boxes.fadeIn();
$( ".popup-loader" ).hide();
$container.masonry({
itemSelector : '.loop',
columnwidth: 300,
gutter: 23,
isFitWidth: true,
isAnimated: !Modernizr.csstransforms
});
});
var msnry = $container.data('masonry');
$container.infiniteScroll({
path: '#page-nav a',
append: '.loop',
outlayer: msnry,
history: false
});
});