Jump to content
Search Community

ScrollTo help

Anastasia_polo test
Moderator Tag

Recommended Posts

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 } })

 

1st_click.jpg

2nd_click.jpg

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...