<section class="slideshow" id="slideshow">
<div id="slides">
<div class="slides-container">
<div class="slide">
<img src="img/people.jpeg" alt="Cinelli">
</div>
<div class="slide">
<img src="img/surly.jpeg" width="1024" height="682" alt="Surly">
</div>
<div class="slide">
<img src="img/cinelli-front.jpeg" width="1024" height="683" alt="Cinelli">
</div>
<div class="slide">
<img src="img/affinity.jpeg" width="1024" height="685" alt="Affinity">
</div>
</div>
<nav class="slides-navigation">
<a href="#" class="next"></a>
<a href="#" class="prev"></a>
</nav>
</div>
</section>
I have created a slider that works perfectly, but it takes some time to load. I am working on a platform that hides all elements until you check a checkbox to reveal them. The slider container is shown, but the content does not display immediately because it has not finished loading before being hidden.
Is there a way to ensure that the slider fully loads before hiding it?
if ($('#slideshow_checkbox').prop('checked')) {
$('#slideshow').show();
} else {
$('#slideshow').hide();
}