luis-almeida / unveil

A very lightweight jQuery plugin to lazy load images
4.16k stars 676 forks source link

How to check if all images are loaded #134

Open plisvb opened 7 years ago

plisvb commented 7 years ago

Is there a way to check if all images have been loaded?

I want to print the images on the page but I want to force a load of all the images first: Which is done with this: $("img").trigger("unveil");

But then I want to check that all images are loaded before initiating the print dialog.

qodeboy commented 7 years ago

You can count all images first and than icrease counter in unveil's load callback. If they match than all images are unveiled. You probably would need to apply some scope to count only images in your page section of interest.