Forums Forums Search & Filter Pro Detect Ajax call

Tagged: 

  • This topic has 2 replies, 2 voices, and was last updated 7 years ago by Anonymous.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #139640

    Hey,

    We’re integrating Photoswipe with Search/Filter Pro. However Photoswipe only knows about the elements in the DOM on page load and does not know when new items get added (through ajax). Is there a hook we could use to tell Photoswipe to rebuild its index when Search/Filter Pro has an successful ajax request?

    Thanks, Adam

    Trevor
    #139641

    Indeed there is. Replace the comment in this code with whatever Photoswipe needs to do:

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

    Thanks, Will try this!

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