Share Posted March 19 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. Link to comment Share on other sites More sharing options...
Share Posted March 19 There isn't enough detail in your post for us to reasonably help. I'm unsure why you need two tweens for this since they execute simultaneously. It seems like this could be accomplished in one `from` tween or `fromTo` tween without issue. One optimization is to use `autoAlpha` instead of `opacity`. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now