• Resolved antk

    (@antk)


    I recently started playing around with the infinite scroll feature of the wordpress jetpack plugin. It seems to work ok, but I’m trying to integrate with Masonry, so I need to use the post-load event that’s supposed to fire when Jetpack loads more posts.

    But I can’t seem to catch that event.

    I have a very minimal set up (with a supported, default theme – twentyfourteen) and I added this small script to footer.php to try and catch the event:

    <script type='text/javascript'>
         document.body.addEventListener("post-load", function() {
            alert('posts loaded');
         });
    </script>

    But I never get my alert even though the new posts are loaded.

    Any ideas?

    Thanks in advance.

    https://wordpress.org/plugins/jetpack/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    This small tutorial should help you add Infinite Scroll support to a theme using Masonry:
    http://wptheming.com/2013/04/jetpack-infinite-scroll-masonry/

    Let me know if you still run into issues.

    Thread Starter antk

    (@antk)

    Hi Jeremy,

    Thanks for replying. Yeah, I came across that tutorial, but I couldn’t even get the post-load event to fire, so figured I’d at least get that going first.

    But it still didn’t fire for me. So I ended up using Paul Irish’s script and everything is fine and dandy.

    http://www.infinite-scroll.com

    Thoughts on this? I’d like to use jetpack, but I just couldn’t see that post-load event, even in the simplest example.

    Thanks.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    post-load seems to work on my end. Could you try something like this?

    jQuery( document ).ready( function( $ ) {
    $( document.body ).on( 'post-load', function () {
    alert('posts loaded');});
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Infinite Scrolling post-load event does not fire’ is closed to new replies.