$(function () { $('.section-1 .section-1-slider').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: true, adaptiveHeight: true, asNavFor: '.section-1 .slider-tabs', dots: true, appendDots: '.section-1 .slider-dots', touchMove: false, swipe: false, draggable: false, autoplay: true, autoplaySpeed: 15000, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, }); $('.section-1 .slider-tabs').slick({ slidesToShow: 5, slidesToScroll: 1, asNavFor: '.section-1 .section-1-slider', dots: false, centerMode: true, focusOnSelect: true, arrows: false, responsive: [ { breakpoint: 768, settings: { slidesToShow: 3, variableWidth: true, } }, ] }); $('button', $('.slick-dots')).click(function (){ $('.section-1-slider').slick('slickPause'); }) $('.slider-tab').click(function (){ $('.section-1-slider').slick('slickPause'); }) $('.section-1 .btn-prev').click(function () { $('.section-1-slider').slick('slickPrev'); $('.section-1-slider').slick('slickPause'); return false; }); $('.section-1 .btn-next').click(function () { $('.section-1-slider').slick('slickNext'); $('.section-1-slider').slick('slickPause'); return false; }); $('.service-fee-table-container .show-more').click(function () { $('.service-fee-table-container').addClass('active'); return false; }); $('.statement-title').click(function () { $('.statement-content').slideToggle(); $(this).toggleClass('active'); return false; }); $('.tabs-wrap a').click(function () { var target = $(this).data('target'); var title_height = 0; console.log($('.'+target).find('.section-title .title-wrap')); if($('.'+target).find('.section-title .title-wrap').length != 0){ title_height = $('.'+target).find('.section-title .title-wrap').height(); } $("html").animate( { scrollTop: $('.'+target).offset().top - $('.site-header').height() - title_height }, 800 //speed ); return false; }); /**/ $(document).ready(function () { var existSwiper, newclSwiper, clinnSwiper; existSwiper = new Swiper(".existSwi", { slidesPerView: 1, spaceBetween: 20, autoHeight: true, centeredSlides: false, loop: true, navigation: { nextEl: ".ext-next", prevEl: ".ext-prev", }, autoplay: { delay: 4000, disableOnInteraction: false, }, }); newclSwiper = new Swiper(".newclSwi", { slidesPerView: 1, spaceBetween: 20, autoHeight: true, centeredSlides: false, loop: true, navigation: { nextEl: ".newcl-next", prevEl: ".newcl-prev", }, autoplay: { delay: 4000, disableOnInteraction: false, }, }); newclSwiper.on('slideChange', function () { //console.log('*** mySwiper.realIndex', newclSwiper.realIndex); $('.newclSwi').closest('.stepscontain').find('.word .steps .contxt').removeClass('currentStep'); $('.newclSwi').closest('.stepscontain').find('.word .steps .contxt').eq(newclSwiper.realIndex).addClass('currentStep'); }); existSwiper.on('slideChange', function () { //console.log('*** mySwiper.realIndex', newclSwiper.realIndex); $('.existSwi').closest('.stepscontain').find('.word .steps .contxt').removeClass('currentStep'); $('.existSwi').closest('.stepscontain').find('.word .steps .contxt').eq(existSwiper.realIndex).addClass('currentStep'); }); $('.exist .contxt').on('click', function () { var thsINX_o = $(this).index() + 1; existSwiper.slideTo(thsINX_o); }); $('.newcl .contxt').on('click', function () { var thsINX = $(this).index() + 1; newclSwiper.slideTo(thsINX); }); $('.tab-bar .downloadnow').on('click', function () { $('.tab-bar .downloadnow').removeClass('active'); $('.tab-bar .downloadnow[data-id="' + $(this).attr('data-id') + '"]').addClass('active'); $('.newcl, .exist').hide(); var ja = '.' + $(this).attr('data-id'); $(ja).toggle(); var na = eval($(this).attr('data-title')); na.update(); na.slideTo(1); }); $('.tabB .tabBtn').on('click', function () { $('.tabB .tabBtn').addClass('not_on'); $(this).removeClass('not_on'); var ja = '.' + $(this).attr('data-id'); $(ja).toggle(); var na = eval($(this).attr('data-title')); na.update(); na.slideTo(1); }); $('.slider_on_off').on('click', function () { $('.slider_contain').toggle(); $(this).toggleClass('opened'); var ja = '.' + $(this).attr('data-id'); $(ja).toggle(); if ($(this).hasClass('opened')) { var na = eval($(this).attr('data-title')); na.update(); na.slideTo(1); setTimeout(function () { console.log(na); }, 600); } }); $(window).resize(function () { newclSwiper.update(); existSwiper.update(); }); }); })