본문 바로가기

Library/swiper

[swiper] 활성화된 슬라이드에 이벤트주기

 

<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
<script>
    var swiper = new Swiper(".mySwiper", {
        slidesPerView: "auto",
        on: {
            setTranslate: function () {
                $(".swiper-slide-active .card_wrap .card").addClass("pick");
                $(".swiper-slide-active .cardinfo_wrap .cardinfo_cont .cardinfo .select_box select").attr('disabled', false);
            },
            slideChangeTransitionStart : function(){
                $(".swiper-slide-active .card_wrap .card").addClass("pick");
                $(".swiper-slide-active .cardinfo_wrap .cardinfo_cont .cardinfo .select_box select").attr('disabled', false);
                $(".swiper-slide-prev .card_wrap .card").removeClass("pick");
                $(".swiper-slide-prev .cardinfo_wrap .cardinfo_cont .cardinfo .select_box select").attr('disabled', true);
                $(".swiper-slide-next .card_wrap .card").removeClass("pick");
                $(".swiper-slide-next .cardinfo_wrap .cardinfo_cont .cardinfo .select_box select").attr('disabled', true);
            }
        }
    });
</script>
반응형