/* Demo Scripts for Bootstrap Carousel and Animate.css article * on SitePoint by Maria Antonietta Perna */ (function( jQuery1_11_2 ) { //Function to animate slider captions function doAnimations( elems ) { //Cache the animationend event in a variable var animEndEv = 'webkitAnimationEnd animationend'; elems.each(function () { var jQuery1_11_2this = jQuery1_11_2(this), jQuery1_11_2animationType = jQuery1_11_2this.data('animation'); jQuery1_11_2this.addClass(jQuery1_11_2animationType).one(animEndEv, function () { jQuery1_11_2this.removeClass(jQuery1_11_2animationType); }); }); } //Variables on page load var jQuery1_11_2myCarousel = jQuery1_11_2('#main_carousel, #sub_carousel'), jQuery1_11_2firstAnimatingElems = jQuery1_11_2myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); //Initialize carousel jQuery1_11_2myCarousel.carousel(); //Animate captions in first slide on page load doAnimations(jQuery1_11_2firstAnimatingElems); //Pause carousel ÀÚµ¿À¸·ÎÇϰųª ¼öµ¿À¸·Î ÇÏ´Â °÷ // $myCarousel.carousel('pause'); //Other slides to be animated on carousel slide event jQuery1_11_2myCarousel.on('slide.bs.carousel', function (e) { var jQuery1_11_2animatingElems = jQuery1_11_2(e.relatedTarget).find("[data-animation ^= 'animated']"); doAnimations(jQuery1_11_2animatingElems); })(jQuery1_11_2); });