Forums › Forums › Search & Filter Pro › AJAX Loading breaks Lightbox
- This topic has 4 replies, 2 voices, and was last updated 5 years, 3 months ago by
Trevor.
-
Anonymous(Private) December 7, 2020 at 10:52 am #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(Private) December 7, 2020 at 10:58 am #268957If 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> -
AuthorPosts