Hi There, I tried replacing
const panels = gsap.utils.toArray("#panels-container .panel");
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 ),
duration: {min: 0.1, max: 0.1}
},
end: () => "+=" + (panelsContainer.offsetWidth - innerWidth)
}
});
with
onst tl = gsap.timeline({
paused: true,
scrollTrigger: {
trigger: "#panels-container",
pin: true,
start: "top top",
scrub: 0.5,
snap: {
snapTo: (1/1.1) / ( panels.length - 1 ),
duration: {min: 0.1, max: 0.1}
},
end: () => "+=" + (panelsContainer.offsetWidth - innerWidth)
}
})
.to(panels, {
xPercent: -100 * ( panels.length - 1 ),
ease: "none", duration: 1
})
.to({}, {duration: 0.1}, 1);
but the whole things breaks, sorry i am not that great at Javascript. Is there a way to update this codepen
https://codepen.io/GreenSock/pen/bGexQpq
Thanks Jim