Close

Reload lazy images

ianhoughton
10 days 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
10 days ago
#21459 Quote
Avatar
  • Moderator
  • 1515
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,
Boyko Stanev
Nop-Templates.com