$(document).ready(function () { $(".imgbg img").each(function () { $(this).parents(".imgbg").css("background-image", "url(" + $(this).attr("src")+")"); }); }); $(document).ready(function () { var tabsSwiper = new Swiper('#tabs-container', { speed: 500, pagination: { el: '.swiper-pagination', clickable: true, }, autoplay:true, on: { slideChangeTransitionStart: function() { $(".tabs .active").removeClass('active'); $(".tabs a").eq(this.activeIndex).addClass('active'); } } }) $(".tabs a").on('mouseover', function(e) { e.preventDefault() $(".tabs .active").removeClass('active') $(this).addClass('active') tabsSwiper.slideTo($(this).index()) }) }); $(document).ready(function () { var tabsSwiper01 = new Swiper('#tabs-container01', { speed: 500, autoHeight: true, on: { slideChangeTransitionStart: function() { $(".tabs01 .active").removeClass('active'); $(".tabs01 a").eq(this.activeIndex).addClass('active'); } } }) $(".tabs01 a").on('click', function(e) { e.preventDefault() $(".tabs01 .active").removeClass('active') $(this).addClass('active') tabsSwiper01.slideTo($(this).index()) }) });