Forums Forums Search & Filter Pro Modal won't fire when loaded via Ajax.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #193790

    I have a model that displays additional content inside my custom results template. It works great as long as it is not loaded via Ajax. Any ideas how to remedy this? I’m using Reveal modal from Zurb. Here’s my here.

    Trevor
    #193801

    When using Ajax to refresh the page, it will strip the modal code from the posts. It would need to be reapplied. We have the necessary javascript code to prepare to fire that reapplication, but you would need to get from Zurb the actual function or code that you need to run within our code:

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

    Ok, thanks! I’ll find that from Zurb. Where is the best place to insert this script? Should it live in the Search & Filter custom template file I created, in the page template file or enqueued in its own file like other scripts?

    Trevor
    #193848

    If you have no other means to insert scripts, then use a plugin, like this one:

    https://wordpress.org/plugins/tc-custom-javascript/

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