Support » Plugin: WordPress Infinite Scroll - Ajax Load More » Make it work with Salvattore.js

  • Resolved magoz

    (@magoz)


    Hi
    I’m using Salvattore.js which makes possible to display posts in a Masonry style.
    How can I make Ajax Load More compatible with Salvattore.js?

    http://salvattore.com

    Many thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author dcooney

    (@dcooney)

    @magoz,
    I’m not really sure.

    Does Salvattore have a method to re-init the grid after new content?

    Cheers,

    Thread Starter magoz

    (@magoz)

    Thanks for your quick reply @dcooney.

    Yes, they have several methods to add more content. One is adding more items to the same grid and another one is to add a new grid and re-init Salvattore for that grid:
    https://github.com/rnmp/salvattore#methods

    By the way, here is the web I’m working on where you can see Ajax Load More and Salvattore implemented and working, but after you click on the Load More button, it loads the new content without the grid.
    http://b.magoz.is

    Thanks again for your help!!

    Plugin Author dcooney

    (@dcooney)

    Im not sure any of these methods would work after the ajax call.

    What we need is a method to re-initialize the grid.

    Would calling salvattore.appendElements(grid, [item]); do this? After ajax complete?

    Thread Starter magoz

    (@magoz)

    I think something like this will re-initialize the grid:

    var grid = document.getElementById('grid');
    salvattore.recreateColumns(grid);

    Found it here.

    The code you posted is for adding new items to an existing grid. It might work as well since I found a conversation where they talk about it here, but it will result in having one single grid.

    There is a third option which it would be to create a new grid every time the infinite scroll is triggered. I think this can be achieved using the registerGrid method, which Adds a new grid to salvattore. Which is initialized automatically then..
    Found in the Methods page.

    What do you think about it @dcooney?
    By the way, I’m planning to use your SEO extension as well.

    Thanks again for your help, I really appreciate it!

    Plugin Author dcooney

    (@dcooney)

    Are you able try either of these methods?

    Thread Starter magoz

    (@magoz)

    Hi @dcooney, unfortunately, my javascript knowledge is very limited and I’m not sure how to connect both (Ajax Load More & Salvattore).
    I suspect it must be very similar to the code you have on your website to make Ajax Load More work with Masonry?

    I really appreciate your help.
    Thanks again!

    Plugin Author dcooney

    (@dcooney)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Make it work with Salvattore.js’ is closed to new replies.