Grow your CSS skills. Land your dream job.

Infinite Scroll + Waypoints

  • # May 23, 2013 at 10:39 am

    hi guys. im using infinite scroll and a waypoints function on wp theme but everytime it executes the IS scroll function to load new posts, my waypoints function breaks. is there any way to execute the waypoints function for the new posts generated by infinite scroll. here is my code:


    (function($) {
    //Infinite Scroll + Waypoints Timeline Nav
    var infinite_scroll = {
    loading: {
    msgText: "Loading the next set of posts",
    finishedMsg: "All posts loaded"
    },
    "nextSelector":"#nav-below .nav-previous-load-more a",
    "navSelector":"#nav-below",
    "itemSelector":"article",
    "contentSelector":"#content .posts"
    };
    $( infinite_scroll.contentSelector ).infinitescroll( infinite_scroll );

    var sections = $("article");
    var navigation_links = $(".navigation-timeline a");
    sections.waypoint({
    handler: function(direction) {

    var active_section;
    active_section = $(this);
    if (direction === "up") active_section = active_section.prev();

    var active_link = $('.navigation-timeline a[data-anchor="' + active_section.attr("data-scroll") + '"]');
    navigation_links.removeClass("active");
    active_link.addClass("active");

    },
    offset: '5%'
    })
    })(jQuery);

    The Doc i think you can help me with this one!
    d.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".