Spicing Up the Bootstrap Carousel with CSS3 Animations

hi antonella, i’m highly impressed on your approach to help. :smile:

Your previous code was fine to work with $(window).load( ) . Its me, who mixed the code with some other things. I was trying to randomize the slide. so, i tried some thing like this.

var slideNum = $(‘#my-carousel .item’).length;
var randSlide = Math.floor( Math.random()*slideNum);
$(‘#my-carousel .item’).eq(randSlide).addClass(‘active’);

this code conflicted with your code which was initialized with the ‘.item:first’. Randomly when the randSlide value was first, i got the animation for the first slide. So, when i stopped randomization, everything worked fine.

Later i tried to customized your code something like this. but it didn’t worked.

var $myCarousel = $(‘#my-carousel’),
$firstAnimatingElems = $myCarousel.eq(randSlide).find(“[data-animation ^= ‘animated’]”);