Hello guys,
I have 3 questions.
1- How can I tell ScrollTrigger to end the scroll animation when 60% of the div height has been scrolled up?
2- How can I tell ScrollTrigger to end the scroll animation when (70%+5em) of the div height has been scrolled up?
3- Also, another question: I saw this format somewhere: end: ="+500" what does this mean?
this is the one I have used but didn't work.
ScrollTrigger.create({
trigger: ".s2-wr.projects",
scroller: ".sections-wr",
start: "40em 0%",
end: 'center+=100px center',
markers: true,
scrub: 0.2,
onEnter: () => gsap.to('.s2-wr.projects', {
backgroundColor: "#ffffff",
duration: 0.2,
}),
onLeave: () => gsap.to('.s2-wr.projects', {
backgroundColor: "#000000",
duration: 0.2,
}),
onLeaveBack: () => gsap.to('.s2-wr.projects', {
backgroundColor: "#000000",
duration: 0.2,
}),
onEnterBack: () => gsap.to('.s2-wr.projects', {
backgroundColor: "#ffffff",
duration: 0.2,
}),
});