Anastasia_polo Posted March 25, 2022 Share Posted March 25, 2022 Hey guys, I need your help. I'm using a scrollTo animation for multitoggler in react. This toggler is inside the content. When I clicked the first time it moved on the content, so I've added extra offsetY space. It looked okay, but when I clicked the second time this extra 150 create unnecessary space. How to improve my code for better performance? gsap.to(window, { duration: 2, scrollTo: { y: "#booth", offsetY: 150 } }) Link to comment Share on other sites More sharing options...
OSUblake Posted March 25, 2022 Share Posted March 25, 2022 Welcome to the forums @Anastasia_polo Not sure what you mean by performance as that code can't be optimized. It is what is. And if you'd like help, please provide a minimal demo showing the issue. Thanks! 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