Forums › Forums › Search & Filter Pro › My filter result is not scrolling down
- This topic has 12 replies, 3 voices, and was last updated 7 years, 11 months ago by Anonymous.
-
Ross Moderator(Private) December 12, 2016 at 4:29 pm #75751
Hi Alaa
The issue here is that the Javascript that is loaded by your site (as with most websites), is only loaded once, when the page is loaded.
When S&F loads in new posts with ajax, your websites scripts are not “reloaded” so it doesn’t know how it should behave with the infinite scroll…
I’m not sure if there would be more issues integrating the two past this point (as you are integrating theme JS with S&F, and its untested) but it looks like for now this is the main issue.
Just to note, you may have already noticed, but your masonry grid does not work correctly after an ajax request is performed, for the same reason above… when new posts are loaded from S&F, your theme must reload the scripts related to masonry and your infinite scroll..
Fortunately, we have a JS filter for this (first question): https://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/
So you need this part for the script:
//depeding on where you add your JS, sometimes its necessary to wrap the above events in a function (as is standard practise): (function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("S&F JS ajax request finished"); // ** here you need to reload your masonry & pagination/infinite scroll scripts ** }); }(jQuery));
The part
// ** here you need to reload your masonry & pagination/infinite scroll scripts **
is where you should add this code.The next (potentially tricky) part for you is to find out how to do this with your theme, it might be best to open a support ticket with them and refer them to this thread..
If the above is not possible, then you likely won’t be able to use ajax unless you want to add in normal pagination to your pages.
Hope that helps
-
AuthorPosts