I have a ScrollTrigger on a p element on which I want to use gsap.to and gsap.from. I wrote it this way:
gsap.to(".p-blinker", {
duration: 2,
opacity: 1,
scrollTrigger: {
trigger: ".hero",
start: "top 0",
end: "bottom 80%",
// markers: true,
},
});
gsap.from(".p-blinker", {
duration: 2,
y: "150",
scrollTrigger: {
trigger: ".hero",
start: "top 0",
end: "bottom 80%",
// markers: true,
},
});
I wonder If there is a better solution for this? I needed to write it this way because otherwise the p element would stay 150px higher after the animation.