我试图将active slide我slick carousel的ken wheeler中的目标添加到幻灯片中的p元素中.
因此,当slide激活时,p元素将反弹(或某种东西),然后当幻灯片转换到下一张幻灯片时,动画将应用于新的p元素.幻灯片循环后,动画类将继续应用于slick carousel.
HTML:
<div class="slick-promo">
<div class="single-slide">[img code here]<p>This text will come in animated, then as the slide leaves it will have the animation class removed.</p></div>
<div class="single-slide">[img code here]<p>Lorem ipsum blah blah</p></div>
<div class="single-slide">[img code here]<p>lorem ipsum blah blah</p></div>
</div>
Run Code Online (Sandbox Code Playgroud)
这images几个classes是由我使用的其他程序动态生成的.
使用Javascript:
jQuery(document).ready(function($){
$('.slick-promo').slick({
infinite: true,
fade: true,
cssEase: 'linear',
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 2000,
//this is where …Run Code Online (Sandbox Code Playgroud)