$(function (){ $('.menu-button').click(function (){ $('.itemside').toggleClass('active'); }); $(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, .banking_services, .transactions').hide(); var ja = '.' + $(this).attr('data-id'); $(ja).toggle(); if($(this).attr('data-type') == 'swiperTab'){ var na = eval($(this).attr('data-title')); na.update(); na.slideTo(1); } if($(this).attr('data-id') == 'newcl'){ $('.id-type-bar').show(); } else { $('.id-type-bar').hide(); } $("#banking_services_video").get(0).pause(); $("#transactions_video").get(0).pause(); }); $('.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(); }); }); // $('.banking_services .video-steps .contxt').click(function (){ $('.banking_services .video-steps .contxt').removeClass('currentStep'); $(this).addClass('currentStep'); $("#banking_services_video").get(0).pause(); $('#banking_services_video source').attr('src', $(this).attr('data-video')); $('#banking_services_video').get(0).load(); $("#banking_services_video").get(0).play(); //setTimeout(function() {$("#vdo").get(0).play();}, 350); if($(window).width() <= 1023){ $("html, body").animate({ scrollTop: $("#banking_services_video").offset().top - 100}, 750); } return false; }); $('.transactions .video-steps .contxt').click(function (){ $('.transactions .video-steps .contxt').removeClass('currentStep'); $(this).addClass('currentStep'); $("#transactions_video").get(0).pause(); $('#transactions_video source').attr('src', $(this).attr('data-video')); $('#transactions_video').get(0).load(); $("#transactions_video").get(0).play(); //setTimeout(function() {$("#vdo").get(0).play();}, 350); if($(window).width() <= 1023){ $("html, body").animate({ scrollTop: $("#transactions_video").offset().top - 100}, 750); } return false; }); $('.transactions .option-type-wrap a').click(function (){ $('.transactions .option-type-wrap a').removeClass('active'); $(this).addClass('active'); $('.transactions-group').hide(); $('.' + $(this).attr('data-group')).show(); $("#transactions_video").get(0).pause(); $('#transactions_video source').attr('src', $('.' + $(this).attr('data-group')).find('.contxt').eq(0).attr('data-video')); $('.transactions .video-steps .contxt').removeClass('currentStep'); $('.' + $(this).attr('data-group')).find('.contxt').eq(0).addClass('currentStep'); $('#transactions_video').get(0).load(); $("#transactions_video").get(0).play(); //setTimeout(function() {$("#vdo").get(0).play();}, 350); if($(window).width() <= 1023){ $("html, body").animate({ scrollTop: $("#transactions_video").offset().top - 100}, 750); } }); $('.clipBTN').on('click', function () { $('.clipBTN').removeClass('on'); $(this).addClass('on'); changeVDO($(this).attr('data-href')); if($(this).hasClass('fx') || $(this).hasClass('fx_limit') || $(this).hasClass('fx_alert') ){ $('.fxr').show(); }else{ $('.fxr').hide(); } }); $('.tnc_click').click(function() { $(this).next('div').slideToggle(); }); function changeVDO(incoming){ $("#vdo").get(0).pause(); //$('.demo_dest').attr('src', $(this).attr('data-href')); $('#vdo source').attr('src', incoming); $('#vdo').get(0).load(); $("#vdo").get(0).play(); //setTimeout(function() {$("#vdo").get(0).play();}, 350); if($(window).width() <= 1023){ $("html, body").animate({ scrollTop: $(".vdo_contain").offset().top - 100}, 750); } } $('.cateB a').on('click', function () { $('.cateB a').removeClass('active'); $(this).addClass('active'); //changeVDO($(this).attr('data-href')); var nn = '.' + $(this).attr('data-href'); $(nn).trigger('click'); }); $('.second_lv_btn').on('click', function () { //$('.second_lv_btn').removeClass('active'); $(this).toggleClass('active'); $(this).next('.second_lv_sh').slideToggle(); }); // offers page if (typeof mixitup !== "undefined") { var containerEl = document.querySelector('.mix-container'); var mixer = mixitup(containerEl,{ animation: { duration: 0, nudge: false, reverseOut: false, effects: 'fade translateY(20%) stagger(30ms)' }, load: { filter: ':not(.exclude-from-all)' } }); $('.block-nav a').click(function () { $('.block-nav a').removeClass('active'); $(this).addClass('active'); $(".normal-lead-in .lead-in").hide(); var filter = $(this).data('filter'); /*if (filter == 'all') { filter = '.all'; }*/ if (filter == ':not(.exclude-from-all)') { filter = '.all'; } $(".normal-lead-in " + filter).fadeIn(); /*$("html").animate( { scrollTop: $(".main-content").offset().top }, 300 );*/ return false; }); } //aboutus $('.control-bar .btn-wrap .btn').click(function (){ $('.control-bar .btn-wrap .btn').removeClass('active'); $(this).addClass('active'); if($(this).data('target') == 'tnc'){ $('.faq-collapse').hide(); $('.faq-content').hide(); $('.tnc-content').fadeIn(); $('.faq-current').removeClass('active'); $('.tnc-current').addClass('active'); } else if($(this).data('target') == 'faq'){ $('.faq-collapse').show(); $('.tnc-content').hide(); $('.faq-content').fadeIn(); $('.faq-current').addClass('active'); $('.tnc-current').removeClass('active'); } return false; }); $('.faq-question-wrapper').click(function () { $(this).toggleClass('active'); $(this).next().find('.faq-answer-wrapper').slideToggle(); }); $('.faq-collapse a').click(function () { if($(this).hasClass('active')){ $('.faq-wrapper.active').find('.faq-question-wrapper').removeClass('active'); $('.faq-wrapper.active').find('.faq-answer-wrapper').slideUp(); $(this).removeClass('active'); } else { $('.faq-wrapper.active').find('.faq-question-wrapper').addClass('active'); $('.faq-wrapper.active').find('.faq-answer-wrapper').slideDown(); $(this).addClass('active'); } return false; }); $('.faq-cate-btn a').click(function () { $('.faq-cate-btn a').removeClass('active'); $(this).addClass('active'); $('.faq-details .faq-wrapper').removeClass('active'); $('.faq-details .' + $(this).data('target')).addClass('active'); $('.faq-details .faq-wrapper').hide(); $('.faq-details .' + $(this).data('target')).fadeIn(); // $('.faq-collapse a').removeClass('active'); $('.faq-wrapper.active').find('.faq-question-wrapper').removeClass('active'); $('.faq-wrapper.active').find('.faq-answer-wrapper').hide(); $('.faq-wrapper .faq-question-wrapper').addClass('skip-animation'); setTimeout(function (){ $('.faq-wrapper .faq-question-wrapper').removeClass('skip-animation'); },100); // $("html").animate( { scrollTop: $(".faq-tnc-content").offset().top }, 300 ); /*$('.faq-cate-btn').fadeOut(); $('.tnc-cate-btn').fadeOut();*/ $('.faq-cate-btn').removeClass('active'); $('.tnc-cate-btn').removeClass('active'); $('.faq-current span').text($(this).text()); return false; }); $('.tnc-cate-btn a').click(function () { $('.tnc-cate-btn a').removeClass('active'); $(this).addClass('active'); $('.tnc-details .faq-wrapper').removeClass('active'); $('.tnc-details .' + $(this).data('target')).addClass('active'); $('.tnc-details .faq-wrapper').hide(); $('.tnc-details .' + $(this).data('target')).fadeIn(); $("html").animate( { scrollTop: $(".faq-tnc-content").offset().top }, 300 ); $('.faq-cate-btn').removeClass('active'); $('.tnc-cate-btn').removeClass('active'); $('.tnc-current span').text($(this).text()); return false; }); $('.mobile-menu a').click(function (){ if($(this).data('target') == 'tnc'){ //$('.tnc-cate-btn').fadeIn(); $('.tnc-cate-btn').addClass('active'); } else if($(this).data('target') == 'faq'){ //$('.faq-cate-btn').fadeIn(); $('.faq-cate-btn').addClass('active'); } return false; }); $('.faq-cate-btn .mobile-heading .close-btn, .tnc-cate-btn .mobile-heading .close-btn').click(function (){ $('.faq-cate-btn').removeClass('active'); $('.tnc-cate-btn').removeClass('active'); return false; }); }) // hash $( window ).on("load", function() { var hash = window.location.hash; if(hash != ''){ switch (hash){ //how_to_inmotion case '#acctopen': $('.downloadnow[data-id="newcl"]').click(); break; case '#firsttimereg': $('.downloadnow[data-id="exist"]').click(); break; case '#regbankser': $('.downloadnow[data-id="banking_services"]').click(); break; case '#mantxn': $('.downloadnow[data-id="transactions"]').click(); break; // offer case '#saving': $('.control[data-filter=".savings"]').click(); document.querySelector('.control[data-filter=".savings"]').click(); break; case '#invest': $('.control[data-filter=".financial"]').click(); document.querySelector('.control[data-filter=".financial"]').click(); break; case '#spending': $('.control[data-filter=".loans"]').click(); document.querySelector('.control[data-filter=".loans"]').click(); break; case '#upgrade': $('.control[data-filter=".upgrade"]').click(); document.querySelector('.control[data-filter=".upgrade"]').click(); break; // aboutus case '#tnc': $('.tnc-btn').click(); break; case '#support': $('.faq-btn').click(); break; } } })