PageSourceSearch

https://www.guaranamarketing.com/hubfs/hub_generated/module_assets…/module_sticky-slider-nav.min.js

js guaranamarketing.com collected 2026-09-30 19:02:04 UTC 5,079 bytes, 2 lines download raw bytes

1var module_101532427801=(function($){class StickyNavigation{constructor(){this.currentId=null,this.currentTab=null,this.tabContainerHeight=this.calculateContainerHeight(),this.$tabs=$(".et-hero-tab"),this.$window=$(window),this.init()}init(){const self=this;this.$tabs.on("click",(function(event){self.onTabClick(event,$(this))})),this.$window.scroll(this.throttle((()=>this.onScroll()),100)),this.$window.resize(this.throttle((()=>this.onResize()),200))}throttle(fn,delay){let lastCall=0;return(...args)=>{const now=(new Date).getTime();now-lastCall<delay||(lastCall=now,fn(...args))}}onTabClick(event,element){event.preventDefault(),event.stopPropagation();const target=$(element.attr("href"));if(!target.length)return;const scrollTop=target.offset().top-this.tabContainerHeight+1;$("html, body").animate({scrollTop:scrollTop},300,"swing")}onScroll(){this.checkTabContainerPosition(),this.findCurrentTabSelector()}onResize(){this.tabContainerHeight=this.calculateContainerHeight(),this.currentId&&this.setSliderCss()}calculateContainerHeight(){return window.innerWidth>1338?145:135}checkTabContainerPosition(){const $tabs=$(".et-hero-tabs"),$main=$("#et-main");if(!$tabs.length||!$main.length)return;const offset=$tabs.offset().top+$tabs.height()-this.tabContainerHeight,offset2=$main.offset().top+$main.height()-this.tabContainerHeight,scrollTop=this.$window.scrollTop();$(".et-hero-tabs-container").toggleClass("et-hero-tabs-container--top",scrollTop>offset&&scrollTop<=offset2).toggleClass("et-hero-tabs-container--bottom",scrollTop>offset2),$("#header").toggleClass("no-shadow",scrollTop>offset)}findCurrentTabSelector(){let newCurrentId,newCurrentTab;const viewportMiddle=this.$window.scrollTop()+this.$window.height()/2;this.$tabs.each(((index,element)=>{const $tab=$(element),id=$tab.attr("href"),$section=$(id);if($section.length){const sectionTop=$section.offset().top-this.tabContainerHeight,sectionBottom=sectionTop+$section.outerHeight();viewportMiddle>=sectionTop&&viewportMiddle<=sectionBottom&&(newCurrentId=id,newCurrentTab=$tab)}})),this.currentId!==newCurrentId&&(this.currentId=newCurrentId,this.currentTab=newCurrentTab,this.setSliderCss())}setSliderCss(){if(!this.currentTab||!this.currentTab.length)return;const width=this.currentTab.outerWidth(),position_left=this.currentTab.offset().left;this.currentTab.offset().top,this.$tabs.css({color:"","background-color":""}),this.currentTab.css({"background-color":this.currentTab.data("color")||"#081626",color:"#ffffff"}),$(".et-hero-tab-slider").css({width:width+"px",left:position_left+"px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"})}}$(document).ready((()=>{new StickyNavigation}))}(jQuery),void function(){function initTabHighlighting(){setTimeout((function(){try{const tabs={};function updateActiveTab(){const scrollPosition=window.scrollY+window.innerHeight/3;let activeTabId=null;for(const tabId in tabs){const tab=tabs[tabId];if(!tab)continue;const rect=tab.getBoundingClientRect(),sectionTop=rect.top+window.pageYOffset,sectionBottom=sectionTop+rect.height;if(scrollPosition>=sectionTop&&scrollPosition<=sectionBottom){activeTabId=tabId;break}}if(!activeTabId){let closestDistance=1/0;for(const tabId in tabs){const tab=tabs[tabId];if(!tab)continue;const rect=tab.getBoundingClientRect(),sectionMid=rect.top+window.pageYOffset+rect.height/2,distance=Math.abs(scrollPosition-sectionMid);distance<closestDistance&&(closestDistance=distance,activeTabId=tabId)}}document.querySelectorAll(".et-hero-tab").forEach((navTab=>{if((navTab.getAttribute("href")?.substring(1)||navTab.getAttribute("data-target")||navTab.textContent.toLowerCase().trim().replace(/\s+/g,"-"))===activeTabId){navTab.classList.add("active-tab");const section=tabs[activeTabId];if(section){let bgColor=window.getComputedStyle(section).backgroundColor;if("rgba(0, 0, 0, 0)"===bgColor||"transparent"===bgColor){const containers=section.querySelectorAll('.container, .row, [class*="col-"], .et-slide');for(let i=0;i<containers.length;i++){const containerBg=window.getComputedStyle(containers[i]).backgroundColor;if("rgba(0, 0, 0, 0)"!==containerBg&&"transparent"!==containerBg){bgColor=containerBg;break}}}navTab.style.backgroundColor="rgba(0, 0, 0, 0)"!==bgColor&&"transparent"!==bgColor?bgColor:"#3AAFA9"}}else navTab.classList.remove("active-tab"),navTab.style.backgroundColor=""})),console.log("Active tab:",activeTabId)}["tab-karto","tab-konfig","tab-methode","tab-execution"].forEach((id=>{tabs[id]=document.getElementById(id),console.log("Found tab:",id,tabs[id]),tabs[id]&&tabs[id].classList.add("et-hero-tab-section")})),window.addEventListener("scroll",updateActiveTab,{passive:!0}),updateActiveTab(),console.log("Tab highlighting initialized successfully")}catch(err){console.error("Error initializing tab highlighting:",err)}}),1e3)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",initTabHighlighting):initTabHighlighting(
1)}());
2//# sourceURL=https://417746.fs1.hubspotusercontent-na1.net/hubfs/417746/hub_generated/module_assets/1/101532427801/1746708573528/module_sticky-slider-nav.js

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.