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)