$(function(){ var i2_swiper2 = new Swiper('#i2-swiper2', { slidesPerView:'auto', direction : 'vertical', freeMode : true, slideToClickedSlide: true, watchSlidesVisibility: true, mousewheel: true, breakpoints: { 800: { direction : 'horizontal', } } }); $('.i2 .M li').eq(0).addClass('on'); var i2_swiper1 = new Swiper('#i2-swiper1', { speed:1000, effect : 'fade', fadeEffect: { crossFade: true, }, thumbs: { swiper: i2_swiper2, }, autoplay:{delay:5000,stopOnLastSlide: false,disableOnInteraction: false,}, on:{ slideChange: function(){ $('.i2 .M li').eq(this.activeIndex).addClass('on').siblings('li').removeClass('on'); }, }, }); });