$(function(){ var tabsswiper = new swiper('.swiper-container',{ speed:500, onslidechangestart: function(){ $(".tabs .active").removeclass('active') $(".tabs a").eq(tabsswiper.activeindex).addclass('active') } }) $(".tabs a").on('touchstart mousedown',function(e){ e.preventdefault() $(".tabs .active").removeclass('active') $(this).addclass('active') tabsswiper.swipeto( $(this).index() ) }) $(".tabs a").click(function(e){ e.preventdefault() }) var myswiper = new swiper('.swiper-container2',{ pagination: '.pagination', paginationclickable: true, movestartthreshold: 100 }) })