- This topic has 11 replies, 2 voices, and was last updated 5 years, 9 months ago by .
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Masonry, infinite scroll and Ajax
Hi Trevor,
I finaly found the solution using a part of your code and Masonry documentation.
This is my full process to help other if you have a new request about that :
> I create a search&filter form using shortcode method, ajax load and infinite scroll.
> I used the RESULTS template of Infinite scroll but i delete the div ‘search-filter-results-list’.
> I call the masonry JS file and i use this function to apply the masonry system to my grid :
$container = $('.search-filter-results');
$container.masonry({
itemSelector: '.post',
columnWidth: '.post'
});
$(function(){
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
console.log("ajax finish");
$container.masonry('reloadItems');
$container.masonry().append().masonry('appended');
});
}(jQuery));
Thanks a lot for your help.
Simon.