-2

first off, I have read this post and it's approach is not good, but does work, here is my issue:

I am mixing infinite scroll with jquery masonry. My content's height can change before the next posts load. I have a script that will redo the positioning when heights change, but that cannot be applied to posts that are not loaded yet.

When the new posts load, it seems that some of them will overlap if heights increased. This is because masonry is applied on the new posts, and they are appended based on the memory of where the end was from the last masonry callback.

I cannot simply call masonry every time the heights change because with new heights means that a new call of masonry will make content in different places, and that will be very sloppy

question:

The way I see to solve this problem is if I could somehow change the positions that masonry seems to put into memory without recalling all of masonry on the shown content.

Is this possible with masonry, and how can I achieve it?

Community
  • 1
  • 1
Ryan Saxe
  • 14,833
  • 19
  • 66
  • 116

1 Answers1

0

You can try to wrap the new items in an additional container and assign masonry to reload the new container so you have 2 container more. When you have infinite height essential this means you have no more then 1 column. Hence there is a container around the columns. It's not easy problem to solve and a bin packing problem. With a brute force solution there is many combinations to try.

Gigamegs
  • 12,342
  • 7
  • 31
  • 71