Здравствуйте. Помогите пожалуйста разобраться.
Не получается настроить анимацию текста на слайдере
Слайдер slick, подключил animate.css
Хочу, чтобы при смене слайда текст на нем тоже анимировался
Вот код:
// слик-слайдер
$(document).ready(function () {
$('.slider-area__slider-img').slick({
dots: true,
arrows: false,
autoplay: true,
autoplaySpeed: 2500,
fade: true,
fadeSpeed: 1000,
})
});
// анимация текста
$('.slider-area__slider-img').on('changed.owl.carousel', function(event) {
$('.text-container__up-title').addClass('animate__fadeInRight');
setTimeout(function () { $('.text-container__up-title').addClass('animate__fadeInRight'); }, 0);
// ==
$('.text-container__title').addClass('animate__fadeInRight');
setTimeout(function () { $('.text-container__title').addClass('animate__fadeInRight'); }, 0);
// ==
$('.text-container__subtitle').addClass('animate__fadeInRight');
setTimeout(function () { $('.text-container__subtitle').addClass('animate__fadeInRight'); }, 0);
// ==
$('.text-container__btn').addClass('animate__fadeInRight');
setTimeout(function() { $('.text-container__btn').addClass('animate__fadeInRight'); }, 0);
})
<div class="slider-area__slider-img">
<div class="slider-area__slide-wrapper slide-wrapper"><img src="./src/img/sample-1.jpg" alt="1">
<div class="slide-wrapper__text-container text-container">
<h3 class="text-container__up-title animate__animated animate__delay-1s">New Arrivals</h3>
<h2 class="text-container__title animate__animated animate__delay-1s">Back To Reality Suit Set</h2>
<h2 class="text-container__subtitle animate__animated animate__delay-1s">Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia</h2>
<button class="text-container__btn animate__animated animate__delay-1s">SHOP NOW!</button>
</div>
</div>
//====================
<div class="slider-area__slide-wrapper slide-wrapper"><img src="./src/img/sample-1.jpg" alt="1">
<div class="slide-wrapper__text-container text-container">
<h3 class="text-container__up-title animate__animated animate__delay-1s">New Arrivals</h3>
<h2 class="text-container__title animate__animated animate__delay-1s">Back To Reality Suit Set</h2>
<h2 class="text-container__subtitle animate__animated animate__delay-1s">Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia</h2>
<button class="text-container__btn animate__animated animate__delay-1s">SHOP NOW!</button>
</div>
</div>
//================================
<div class="slider-area__slide-wrapper slide-wrapper"><img src="./src/img/sample-1.jpg" alt="1">
<div class="slide-wrapper__text-container text-container">
<h3 class="text-container__up-title animate__animated animate__delay-1s">New Arrivals</h3>
<h2 class="text-container__title animate__animated animate__delay-1s">Back To Reality Suit Set</h2>
<h2 class="text-container__subtitle animate__animated animate__delay-1s">Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia</h2>
<button class="text-container__btn animate__animated animate__delay-1s">SHOP NOW!</button>
</div>
</div>
</div>