Hi folks,
I am working on a project and I am getting this issue (see screenshot) but my code is like this:
//I've commented this out as I was trying to solve it myself.
// gsap.registerPlugin(ScrollTrigger);
gsap.to(".firstBoxLeft", {
scrollTrigger: ".st1",
y: -100,
toggleClass: {
targets: ".firstBoxLeft",
className: "testClass"
},
pin: true,
start: "bottom center",
toggleActions: "play complete play reset",
scrub: 1, // smooth scrubbing, takes 1 second to "catch up" to the scrollbar
markers: {startColor: "red", endColor: "red", fontSize: "18px", fontWeight: "bold", indent: 20},
snap: {
snapTo: 'flexWrapper',
duration: {min: 0.2, max: 3}, // the snap animation should be at least 0.2 seconds, but no more than 3 seconds (determined by velocity)
delay: 0.2, // wait 0.2 seconds from the last scroll event before doing the snapping
ease: "power1.inOut" // the ease of the snap animation ("power3" by default)
}
});
I've read the docs but do not get what I am doing wrong here.
Thank you for the help!