• Hello I’m using infinite scroll plugin (which is pretty amazing) and addthis plugin for share buttons… After more content loads by infinite scroll, button’s don’t appear on loaded posts, could someone help me ? I think that key is in callback javascript, but I don’t know how to write the code to do it for me. Thx for help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • In Settings > Infinte Scroll there is a box for javascript callbacks. If you add the following to calls, AddThis should get rendered correctly.

    addthis.toolbox('.addthis_toolbox');
    addthis.counter('.addthis_counter');

    If that doesn’t work, what is your site’s url? I’ll need to take a look at your implementation to give you the correct code.

    Thread Starter Eldiabel

    (@eldiabel)

    I did:
    if (window.addthis){

    window.addthis.ost = 0;
    window.addthis.ready();
    }
    And it works without problems, but thanks alot.

    This does not work in IE 7-8. Error generated when I do addthis.toolbox(‘.addthis_toolbox’); in the infinite-scroll callback func.

    The IE error:

    Message: Unknown runtime error
    Line: 2
    Char: 104650
    Code: 0
    URI: https://s7.addthis.com/static/r07/core012.js

    The addthis buttons are being added to all the new scolled images in all other browsers.

    adding the addthis individual social buttons on every image is problematic. For every page infinite-scroll loads it loads about hundred javascript files to generate all those individual social like buttons. Really drags loading of the page. We are just going to have single addthis share button per image instead. Much less resource intensive and works in IE 7-8 mostly. IE 7 does not recognize the url passed through the addthis button. Just uses the gallery page the image is sitting in not the individual image link.

    Put this code into callbacks infinite scroll option:

    stButtons.makeButtons();

    Aaron Jorbin is right.That code will definitely work. I am using Infinite scroll masonry.I just added the lines posted by him and it worked.

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    function( newElements ) {
            // hide new items while they are loading
            var $newElems = $( newElements ).css({ opacity: 0 });
            // ensure that images load before adding to masonry layout
            $newElems.imagesLoaded(function(){
              // show elems now they're ready
              $newElems.animate({ opacity: 1 });
              $container.masonry( 'appended', $newElems, true );
              addthis.toolbox('.addthis_toolbox');
              addthis.counter('.addthis_counter');
              addthis.init();
            });
          });

    Thanks Aaron Jorbin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Infinite scroll addthis’ is closed to new replies.