Packery + Infinite Scroll: Stacked Items after loading new items

83 Views Asked by At

I'm using Packery and Infinite Scroll plugins to load new items within masonry list.

I'm using this code on load document

$(window).load(function() {
    var $container = $("#container1");

    $container.packery({
        itemSelector: ".box1"
    });

    $container.infinitescroll({
        navSelector  : "#page-nav",
        nextSelector : "#page-nav a:first",
        itemSelector : ".box1",
        loading: {
            finished: function(){
                window.dispatchEvent(new Event("resize"));
            },
            finishedMsg: "No more pages to load.",
            img: "http://i.imgur.com/6RMhx.gif"
        }
    },
    function( newElements ) {
        $container.packery("appended",newElements);
    });
});

On Chrome my new items not showing correct, but the one up to other...

If i resize screen then my list fixes!

Any solution?

0

There are 0 best solutions below