My website features a Bootstrap Carousel with three elements structured like this:
<a><img data-src="img" alt="Third slide" src="img">
</a>
<div class="carousel-caption">
<h2>
<ul id="columncarro4" type="circle" style="">
<li>text1</li><br>
<li>text</li><br>
<li>text</li>
</ul>
</h2>
</div>
</div>
I have implemented some JavaScript code to adjust the position of the text as desired:
$(document).ready(function(){
$('#columncarro4').animate({
'margin-left':'-3%'
},500).animate({
'margin-left':'-255px'
},'slow');
});
The challenge I face is ensuring that the animation for each slide starts when the corresponding carousel slide appears. Currently, all three animations begin at the start of the webpage and do not sync with the respective slides.