-1

I have blog post that use ajax for load more and mansory.js for display the block.

but when i load more the data my interface broken since its use mansory.js.

how to make ajax load + reload/refresh the mansory.js again?...

here my index.html

....
<script src="plugins/masonry/masonry.js"></script>
<script>
$(document).ready(function(){
   $(document).on('click','#load-more',function(){
       var id = $(this).data('id');
       $("#load-more").html("Loading....");
       $.ajax({
          ....
       });
   });
});
</script>
....
Dicky Raambo
  • 531
  • 2
  • 14
  • 28

1 Answers1

1

Try to call the following method right after post is ajax requested to re-layout the masonry.

$grid.masonry()

or if using vanilla javascript

msnry.layout()
Mel Macaluso
  • 3,250
  • 2
  • 12
  • 26