Close

Reload lazy images

ianhoughton
3 years ago
#21457 Quote
Avatar
  • 1
Hi,

We're using the Emporium template, and have got a modified template that replaces content on the page using ajax. The images are there when first loaded, but when we then make a ajax call and replace the content (filtered), I need to reload the images using lazy loading.

The content being injected into the page has the lazy class applied. What is the best way to do this?

Thanks Ian
Boyko
3 years ago
#21459 Quote
Avatar
  • Moderator
  • 1570
ianhoughton wrote:
Hi,

We're using the Emporium template, and have got a modified template that replaces content on the page using ajax. The images are there when first loaded, but when we then make a ajax call and replace the content (filtered), I need to reload the images using lazy loading.

The content being injected into the page has the lazy class applied. What is the best way to do this?

Thanks Ian


Hi Ian,

You can do what all our plugins do after they add products via ajax.
Simply call the code below after the ajax content is already available on the page.

$.event.trigger({ type: "newProductsAddedToPageEvent" });
Regards,
Nop-Templates.com Team