jQuery not working after AJAX refresh

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)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.