Forums Forums Search & Filter Pro Reload other elements when use ajax

Viewing 1 post (of 1 total)
  • Ross Moderator
    #36455

    Hey Miguel

    Check the first question here:

    https://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/

    You want the code for the event sf:ajaxfinish

    1) so you add the above link to your theme,
    2) use the code for WP image zoooom inside the event handler

    jQuery(document).ready(function( $ ){
    	var options = {<?php echo get_option( 'zoooom_settings_js' ); ?>};
    
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    		console.log("ajax complete");
    		//so load your lightbox or JS scripts here again
    		$(".zoomContainer").remove();
    		$(".attachment-shop_single").image_zoom(options);
    	});
    }

    Depends on how you are adding your JS, but I see a potential problem in their code (which I copied into my example) which may cause you some errors depending on if your JS is loaded inside an external JS file or inline in your site.

    Thanks

Viewing 1 post (of 1 total)