Swiper滑块添加CSS过渡

时间:2018-06-17 18:34:26

标签: jquery swiper

我想通过使用jQuery添加或删除类来使用css过渡来为幻灯片中的元素设置动画。对于例如.addClass() .removeClass().css()。我无法理解如何使用Swiper函数,例如slideChangeTransitionStartslideChangeTransitionEnd

<script>
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 1,
            loop: true,
            spaceBetween: false,
            mousewheel: true,
            speed: 1200,
            parallax: true,
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
            autoplay: {
                delay: 4000,
                disableOnInteraction: false,
            },

            slideChangeTransitionStart(Swiper) {
                // What I should write here?
            },              
});
</script>

    <div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide slide-01"></div>
        <div class="swiper-slide slide-02"></div>
        <div class="swiper-slide slide-03"></div>
        <div class="swiper-slide slide-04"></div>
    </div>
    <div class="swiper-pagination"></div>
    </div>

0 个答案:

没有答案