aFarkas/lazysizes

How to trigger immediate load of images

c9mb opened this issue · 1 comments

c9mb commented

I've tried to find how this could be done, but no luck.

Under certain conditions, I need to be able to force the immediate loading of all images, regardless of their scroll position.

This is because pages sometimes need to be rendered to a PDF via a REST-API, and when the user wants that to happen I need to make sure all the images are immediately loaded so they will be displayed in the document.

c9mb commented

Solved it - basically find all the img elements being lazyloaded and use lazySizes.loader.unveil(imgElem) - this allows me to load the images for the PDF converter which won't know how to deal with the scroll-into-view issue.