I only want to add "fadeInLeft" class to the next carousel item's caption(h1 tag) but not the other h1 tags from its items' siblings as well as remove the class if it exist to be able to see the fadeInLeft effects when slide.
So this is my jQuery function:
function onChange() {
var el = $('.owl-carousel h1');
if ((el).is('.animated.fadeInLeft')) {
el.removeClass('fadeInLeft')
.addClass('fadeInLeft');
} else {
el.addClass('fadeInLeft');
}
}
$('.owl-carousel').owlCarousel({
onChange: onChange,
items: 1,
loop: true,
nav: true,
pagination: true
});
And this is the content:
<div class="owl-carousel owl-theme">
<div class="item item1">
<div class="inner">
<h1 class="animated fadeInLeft">Some Text</h1>
</div>
</div>
<div class="item item2">
<div class="inner">
<h1 class="animated">Some Text</h1>
</div>
</div>
<div class="item item3">
<div class="inner">
<h1 class="animated">Some Text</h1>
</div>
</div>
I use animate.css and owl-carousel plugin.
Please help me and thanks in advance.. :)