Hello good day,
I have an issue within scrollTrigger and scrollSmoother. Sometimes my website loads all animations correctly, other times incompletely.
I think it has to do with the fact that scrollTrigger has already finished doing its calculations but the page hasn't finished loading all its elements yet. The reason is that if I scale the browser window, it fixes
Is there a way to update or refresh scrollTrigger or scrollSmoother? For example, refresh when some DIV enters the viewport or when all elements finish loading?
I tried adding ScrollTrigger.refresh() like this code below, but I am not sure how to implement it
gsap.to('.amenidadSectionColBottom', {
opacity: 1,
ease: 'none',
scrollTrigger: {
trigger: '#amenidadSection',
start: '30% 80%',
end: '50% 70%',
scrub: true,
onEnter: () => ScrollTrigger.refresh(),
}
});
Thanks in advanced for your help