Gsap ScrollTrigger Snap disturbing the whole app while I'm a using it only in a single component
It snaps different sections automatically up and down
is there any solution for this?
const panels = gsap.utils.toArray("#panels-container .panel");
tween = gsap.to(panels, {
xPercent: -100 * (panels.length - 1),
ease: "none",
scrollTrigger: {
trigger: "#panels-container",
pin: true,
start: "top top",
scrub: 1,
snap: {
snapTo: 1 / (panels.length - 1),
inertia: true,
duration: { min: 0.1, max: 0.1 },
},
end: () => "+=" + (panelsContainer.offsetWidth - innerWidth)
}
});