AJAX Loading breaks Lightbox

Forums › Forums › Search & Filter Pro › AJAX Loading breaks Lightbox

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #268952

    Hello,

    I am using “ARI Fancy Lightbox” (http://wp-quiz.ari-soft.com/plugins/wordpress-fancy-lightbox.html) to open PDFs in a Lightbox. These are organised as loop, which are filtered by S&Q.

    As soon as I enable AJAX filtering the Lightbox breaks – doesn’t work any more.

    The author of the Fancy Lightbox asks if there is any javascript API to call a custom code when results are filtered?

    Thanks!

    Trevor
    #268957

    If you are using Ajax in the form to refresh the results and this happens, and if you disable Ajax in the form and it does not happen, then what you need is to reapply the lightbox script to the posts after the Ajax has finished. You would need to know the actual script being used by your lightbox plugin, but the JavaScript would look like this:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        // call your lightbox script or function here
      });
    }(jQuery));</script>
    Anonymous
    #269493

    Thanks very much!

    It works now! 🙂

    Anonymous
    #269495

    Here is the final code, maybe useful to others:

    Code:

    $(document).on("sf:ajaxfinish", ".searchandfilter", function() {
      ARI_FANCYBOX_INSTANCE.convertElements();
    });
    Trevor
    #269508

    Thanks for sharing. I will close this thread for now.

Viewing 5 posts – 1 through 5 (of 5 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.