0

I use "https://salvattore.js.org/" as masonry layout for my product list. I also use filters which is done with Ajax. (I am working on Prtestashop v1.6). So, when filters is active/An ajax call was made, the masonry layout not working.

I found the similar question here: jQuery doesn't work after content is loaded via AJAX

and I think this solution must work for me:

$( document ).ajaxStop(function() {

//your code

}

But I don't know where I must place it? Inside Ajax or in salvattore.min.js? Or I must look for a different masonry solution?

AndrewS
  • 1,555
  • 4
  • 20
  • 32
  • This is not am optimum solution, as `ajaxStop` will fire each time an ajax request fires. Your goal is to detect when producs are loaded and added to the DOM. Only then you should initialize the plugin you mentioned. – nikksan Dec 02 '18 at 16:40
  • I think you need re-initialize once ajax content loaded. It will be nice if you add snippet or fiddle version. – Hanif Dec 02 '18 at 17:46

0 Answers0