Jump to content
Search Community

ScrollToPlugin - click on a button stays halfway

Alan Senderovich test
Moderator Tag

Recommended Posts

Hello everyone!

I have this code and when I click on the button, the animation of taking me to the next section stops halfway.
On desktop it almost reaches the next section, and on mobile it barely moves.
I need that when the button is clicked, it goes to the next complete section.
 

I will greatly appreciate any kind of help!

Thanks for your time!

See the Pen qBLQOKG by Alan-Senderovich-the-vuer (@Alan-Senderovich-the-vuer) on CodePen

Link to comment
Share on other sites

Hi @Alan Senderovich 

 

You will have to map the location you want to scroll to to the total scroll distance of your ScrollTrigger. Check out gsap.utils.mapRange() function for that (https://greensock.com/docs/v3/GSAP/UtilityMethods/mapRange())

 

Someone asked something similar a view days ago, with the pen below as answer. Hope it helps and happy tweening! 

 

 

 

See the Pen bGOOZaV by mvaneijgen (@mvaneijgen) on CodePen

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...