0%

//AFTER FULLPAGE function closest(el, selector) { if(el && el.nodeType === 1){ if(matches(el, selector)){ return el; } return closest(el.parentNode, selector); } return null; } jQuery.fn.fullpage.resetFPSlider = function(section){ var slides = jQuery('.mcw-fp-section').filter('[data-anchor="'+section+'"]').find('.fp-slides'); var destiny = slides.find('.fp-slide:first-child'); if(destiny.length){ console.log(closest(destiny, '.fp-slides')); fullpage_api.landscapeScroll(closest(destiny, '.fp-slides'), destiny); } }; //AFTERLOAD if (jQuery('.mcw-fp-section').filter('[data-anchor="'+origin.anchor+'"]').find('.fp-slides').length) { jQuery.fn.fullpage.resetFPSlider(origin.anchor); } ////////////OLD//////////////// /////ONLEAVE if( origin.anchor == 'master' ){ jQuery('.mcw-fp-section').filter('[data-anchor="master"]').find('.jet-tabs__control').filter('[data-tab="1"]').click(); } if( origin.anchor == 'demonstrate' ){ jQuery('.mcw-fp-section').filter('[data-anchor="demonstrate"]').find('.jet-tabs__control').filter('[data-tab="1"]').click(); } if(jQuery(window).width() > 1024){ if( destination.anchor == 'master' ){ tabcontrol = jQuery('.mcw-fp-section').filter('[data-anchor="master"]').find('.jet-tabs__control'); fullpage_api.setAllowScrolling(false); var tabcount = 1; var allowscroll = true; jQuery(window).on('wheel', function(event){ if(event.originalEvent.deltaY < 0){ tabcount--; if(tabcount == 0) { fullpage_api.setAllowScrolling(true); } else { tabcontrol.filter('[data-tab="'+tabcount+'"]').click(); } } else { tabcount++; if(tabcount == 5) { fullpage_api.setAllowScrolling(true); } else { tabcontrol.filter('[data-tab="'+tabcount+'"]').click(); } } }); } if( destination.anchor == 'demonstrate' ){ tabcontrol = jQuery('.mcw-fp-section').filter('[data-anchor="demonstrate"]').find('.jet-tabs__control'); fullpage_api.setAllowScrolling(false); var tabcounttwo = 1; jQuery(window).on('wheel', function(event){ if(event.originalEvent.deltaY < 0){ tabcounttwo--; if(tabcounttwo == 0) { fullpage_api.setAllowScrolling(true); } else { tabcontrol.filter('[data-tab="'+tabcounttwo+'"]').click(); } } else { tabcounttwo++; if(tabcounttwo == 4) { fullpage_api.setAllowScrolling(true); } else { tabcontrol.filter('[data-tab="'+tabcounttwo+'"]').click(); } } }); } } //// after fullpage jQuery('#fp-nav li:nth-child(2) .extra-nav span').on('click', function() { navid = jQuery(this).data('nav'); navid = navid.replace(/^0+/, ''); jQuery('.mcw-fp-section').filter('[data-anchor="master"]').find('.jet-tabs__control').filter('[data-tab="'+navid+'"]').click(); }); jQuery('#fp-nav li:nth-child(3) .extra-nav span').on('click', function() { navid = jQuery(this).data('nav'); navid = navid.replace(/^0+/, ''); jQuery('.mcw-fp-section').filter('[data-anchor="demonstrate"]').find('.jet-tabs__control').filter('[data-tab="'+navid+'"]').click(); }); jQuery('.jet-tabs__control').on('click', function() { thistab = jQuery(this); tabid = thistab.data('tab'); if(tabid == '1') { thistab.closest('section').find('.master-left-column').find('.elementor-column-wrap').removeClass('hidebgimage'); } else { thistab.closest('section').find('.master-left-column').find('.elementor-column-wrap').addClass('hidebgimage'); } jQuery('#fp-nav').find('span[data-nav^="0"]').removeClass('active'); setTimeout(function() { jQuery('#fp-nav').find('span[data-nav="0'+tabid+'"]').addClass('active'); },300); thistab.closest('.elementor-column').find('div[data-quote^="0"]').addClass('hide'); thistab.closest('.elementor-column').find('div[data-quote="0'+tabid+'"]').removeClass('hide').addClass('show'); thistab.closest('section.mcw-fp-section').find('div[data-img^="0"]').addClass('hiding'); setTimeout(function() { thistab.closest('section.mcw-fp-section').find('div[data-img^="0"]').addClass('hide').removeClass('hiding'); },400); setTimeout(function() { thistab.closest('section.mcw-fp-section').find('div[data-img="0'+tabid+'"]').removeClass('hide').addClass('show'); },1000); setTimeout( function() { var instance = fullpage_api.getActiveSection().item.querySelector('.fp-scrollable'); if(instance != null) { fpscroll = instance.fp_iscrollInstance; fpscroll.scrollTo(0, 0, 1000); fpscroll.refresh(); } if(jQuery(window).width() < 769){ fullpage_api.reBuild(); } }, 200); });