Let's assume I have several img tags in my html document, all of them are supposed to be shown in a slideshow that shows one image at a time.
<div id="gallery">
<img class="slide" src="images/1.png" width="600" height="400" alt=""/>
<img class="slide" src="images/2.png" width="600" height="400" alt=""/>
<img class="slide" src="images/3.png" width="600" height="400" alt=""/>
<img class="slide" src="images/4.png" width="600" height="400" alt=""/>
</div>
I don't want to display these images until they are loaded all and once they are loaded all I would like to present them as a slideshow (that part is not important).
The thing I cannot really understand how it works is the loading of images while being hidden. Let's assume I hide them all with display:none
after $.ready, would this not prevent them from loading in some browsers? If I leave them visible, some images may appear before all of them are loaded, which is undesirable. I don't want to load them using ajax.
Once again what I am trying to do:
have the images in html, not load them with ajax
do not display them until all of them are loaded
Some advice how to achieve this? I am not interested of how to display them when all are loaded, I am interested in how to hide them while loading and that they would still load. Thank you!