I understand that this question has been asked and answered many times, but I still can't get my theme (using Masonry + Infinite Scroll) working due to my lack of JavaScript knowledge.... Like button isn't clickable for those posts loaded using Infinite Scroll. I feel that 20789608 (updated answer on March 5, 2014) is quite close to what I need, but still can't get mine working (don't know how to incorporate/apply correctly). Here is my codes (relevant part only).
JS
<script type="text/javascript">
jQuery(function($){
// with masonry & jQuery
// init masonry
var $grid = $('.grid').masonry({
// masonry options
itemSelector: '.grid-item',
columnWidth: 400,
gutter: 20,
fitWidth: true,
});
// get masonry instance
var msnry = $grid.data('masonry');
// layout masonry after each image loads
$grid.imagesLoaded().progress( function() {
$grid.masonry('layout');
});
{block:IfInfiniteScroll}
// init infinite scroll
$grid.infiniteScroll({
// infinite scroll options
path: '.pagination_next',
append: '.for_infinite_scroll',
outlayer: msnry,
status: '.page-load-status',
});
{/block:IfInfiniteScroll}
});
</script>
HTML
<div id="content" class="grid">
{block:Posts}
<article class="{PostType}{block:PermalinkPage} {block:Date}not-{/block:Date}page{/block:PermalinkPage} {TagsAsClasses} for_infinite_scroll">
{block:Text}
<div class="post grid-item">
{block:Title}
<h1><a href="{Permalink}">{Title}</a></h1>
{/block:Title}
<div>
{Body}
</div>
</div><!-- .post grid-item -->
{/block:Text}
Will be much much appreciated if you could help me resolve this. Thanks in advance!