I'm a beginner in JavaScript and currently learning the ropes. I have a bootstrap slider with images on each slide. My goal is to make the images appear with a slight delay on the slide where they belong. I've managed to achieve this for the first slide using the code below. However, applying my class to other images causes them to appear when the document loads rather than on the specific slide.
This is the JavaScript code I have so far:
$(document).ready(function() {
$('.foo').hide().delay(1).fadeIn(2200);
});
Currently, all images fade in after the delay. How can I modify the code to only apply the fadeIn effect when the user navigates to the respective slide?
I hope I've explained my issue clearly. Please feel free to provide guidance and suggestions. Thank you.