/* Animation delays */ .slider-wrap .carousel-caption { animation-delay: 1s; -webkit-animation-delay: 1s; -moz-animation-delay: 1s; -o-animation-delay: 1s; -moz-transition: none !important; } .slider-wrap .carousel-caption p { animation-delay: 3s; -webkit-animation-delay: 3s; -moz-animation-delay: 3s; -o-animation-delay: 3s; -moz-transition: none !important; }
/* Carousel interval and Text effect */ jQuery(document).ready(function () { var carouselContainer = jQuery('.carousel'); var slideInterval = 9000; //Function to animate slider captions function doAnimations( elems ) { //Cache the animationend event in a variable var animEndEv = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; elems.each(function () { var jQuerythis = jQuery(this), jQueryanimationType = jQuerythis.data('animation'); jQuerythis.addClass(jQueryanimationType).one(animEndEv, function () { jQuerythis.removeClass(jQueryanimationType); }); }); } //Variables on page load var jQuerymyCarousel = jQuery('#carousel-example-generic'), jQueryfirstAnimatingElems = jQuerymyCarousel.find('.item:first').find("[data-animation ^= 'animated']"); //Initialize carousel jQuerymyCarousel.carousel(); //Animate captions in first slide on page load doAnimations(jQueryfirstAnimatingElems); //Pause carousel jQuerymyCarousel.carousel('pause'); //Other slides to be animated on carousel slide event jQuerymyCarousel.on('slide.bs.carousel', function (e) { var jQueryanimatingElems = jQuery(e.relatedTarget).find("[data-animation ^= 'animated']"); doAnimations(jQueryanimatingElems); }); });