Search code examples
javascriptjquerydjangojquery-masonrydjango-endless-pagination

Using Django Endless Pagination with Masonry


I am trying to use Django Endless Pagination with Masonry.

The problem I keep on having is, that Masonry works just fine for the first page, but when new data is populated in the page, masonry does not apply to the new loaded elements. I looked into adding items but I dont think that would help me in this case.

So is their a way to re-initialize masonry once the new elements are loaded?

I was just wondering if anyone else had a similar issue, and if someone has the solution for that?


Solution

  • If someone has a similar issue, I finally found the solution. I ended up using .masonry('reload'). After endless_on_scroll, its easier to just call the reload function again. it takes care of the problem!