Jump to content
GreenSock

Leptitnouveau

getScrollPosition in a timeline

Moderator Tag

Recommended Posts

Hi,

First I would like to apologize if I made some grammatical mistakes or else (I am still learning English)

I did not really understand how does the function getScrollPosition (https://greensock.com/docs/v3/HelperFunctions#getScrollPosition) work. I would have liked to know the Position of an animation that way I can use it as an anchor for my links at the beginning of the page.

 

For example when we click on the first link "Prologue", it leads us to the moment when we see "Prologue" in the left part of the book (In my JavaScript, it is the equivalent of the moment when "tl.from(".prologue", {yPercent:100, opacity: 0});" ends). 

 

Is it possible? 

Thank you in advance and have a great day!

See the Pen XWxwmmN by Leptitnouveau (@Leptitnouveau) on CodePen

Link to comment
Share on other sites

  • Leptitnouveau changed the title to getScrollPosition in a timeline

Hey there, fun project you have here. ☺️

 

Here's a helper function and a demo of it in use - you'll need to load the scrollTo plugin

See the Pen zYmQaVq?editors=0011 by GreenSock (@GreenSock) on CodePen



Hope this helps!

  • Like 1
Link to comment
Share on other sites

Okay, it took me a while but I think that I've fully understood the process.

This forum is really amazing!

 

Thanks a lot 🙂

  • Like 1
Link to comment
Share on other sites

If you have questions feel free to ask! 💚

  • Like 1
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.
×