Forums Forums Search & Filter Pro jQuery not working after AJAX refresh

Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #188253

    Hi, I have a portfolio site and I use the S&F Pro to filter by a custom taxonomy, so far everything works fine. My issue is that all of the jQuery in the page stops working, the OWL carousel, simple click events to open a modal window, etc.

    What do I have to fix all of my custom scripts to continue to work after I filter my results?

    Thanks!

    Trevor
    #188254

    Hi

    They need to be run/initialised again after Ajax has refreshed the results. Adding a script like this to your site will do it:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        console.log("ajax complete");
    
    // call your function(s) here
    
      });
    }(jQuery));</script>
    Anonymous
    #188262

    Thanks! it works perfectly.

Viewing 3 posts - 1 through 3 (of 3 total)