luis-almeida / unveil

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

Preload images with css display: none #77

Open dienstbereit opened 10 years ago

dienstbereit commented 10 years ago

Hi there, is there a solution to preload images with css class display: none?

<img class="image-1" src="loading.gif" data-src="image-1.jpg" />
<noscript><img class="image-1" src="image-1.jpg" /></noscript>
<img class="image-2" src="loading.gif" data-src="image-2.jpg" />
<noscript><img class="image-2" src="image-2.jpg" /></noscript>
.image-2 { display: none: }

thx!

ericnewton76 commented 9 years ago

Why does one need to preload an image that won't be displayed?

Taking this to where I think you're going, which is some kind of carousel, then this library isn't what you're looking for.