0

I have made a theme for Tumblr which uses Masonry with Infinite Scrolling, and for some reason this makes the Like button stop working after the first set of posts. Here is my JS, which is basically this, but with different post selectors:

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
                    <script type="text/javascript" language="javascript">
               $(function(){
                 $("#scrlBotm").click(function(){
                   $("html, body").animate({
                     scrollTop:$(document).height()}
                                           ,1500);
                   return false}
                                     );
                 $("#scrlTop").click(function(){
                   $("html, body").animate({
                     scrollTop:"0px"}
                                           ,1500);
                   return false}
                                    )}
                );
            </script>

            <script type="text/javascript" src="http://static.tumblr.com/dbek3sy/iBElrgjim/jquerymasonry.js"></script>
<script type="text/javascript" src="http://static.tumblr.com/dbek3sy/Qyblrgjfn/jqueryinfintescroll.js"></script>

<script type="text/javascript">
$(window).load(function () {
var $content = $('#content');
$content.masonry({itemSelector: '#posts'}),
$content.infinitescroll({
navSelector : 'div.navigation',
nextSelector : 'div.navigation a#next',
itemSelector : '#posts',
loading: {
finishedMsg: '',
img: ''
},
bufferPx : 600,
debug : false,
},
// call masonry as a callback.
function( newElements ) {
var $newElems = $( newElements );
$newElems.hide();
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
$content.masonry( 'appended', $newElems, true, function(){$newElems.fadeIn(300);} );
});
});
});</script>

I am very new to Javascript, jQuery, and Masonry, so if someone could please explain as simply as possible how to get Like button functionality for my theme/blog, I'd really appreciate it! I have looked at many posts regarding this kind of thing, but unfortunately, none of the solutions seemed to work, unless I was missing something due to my lack of understanding. Here is a link to the blog:http://newyorktheme.tumblr.com.
Thanks!

  • 1
    is this related? infinite scroll loading pages with ajax so you must do some actions after they are loaded i suppose? http://stackoverflow.com/questions/9205377/is-it-possible-to-load-tumblr-posts-via-ajax – llamerr Sep 01 '15 at 00:09
  • 1
    actually this suits better http://stackoverflow.com/questions/30120195/tumblr-like-button-not-working-after-ajax-load same `I am using pjax and masonry in my tumblr theme. ` – llamerr Sep 01 '15 at 00:12

0 Answers0