This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Issue with Lazy Loading of images

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Issue with Lazy Loading of images Reply To: Issue with Lazy Loading of images

#25210
ssoulless45ssoulless45
Participant

Ok, I tried this snipet and added another extra code to close search filters once a filter is applied on mobile (it’s an usability adjustment), however it is breaking up my website, creating an infinite loop and making my website load and load until browser just breaks.

/*trigger the lazyload once the search filtering is finished*/
jQuery(function($) {
var t;
$('body').on("DOMSubtreeModified", function(event, id, instance, phrase) {
   clearTimeout(t);
   setTimeout(function(){
		$(window).scroll();
      	$(document).scroll();
		//Also remove filter screen on mobile once results are loaded
     	if($('.close-sidebar').length){
          $('.close-sidebar').click();
        }
   }, 1000);
 });
});

I really need to catch the exact event once the search filter is applied…