Jump to content
Search Community

I want to create the progress bar on horizontal scroll

Arkaprava101 test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

  • Solution

Just as a general note, as soon as you think you're going to need more then one ScrollTrigger, there will be probably an easier way to do it with one.

 

Timelines are the most powerful part of GSAP and is my opinion the best start point for any animation. So also in your case, you have two things you want to perfectly line up. If you put them on a timeline and use some clever position parameter they will be perfectly in sync. Then one ScrollTrigger that controls that timeline and your animation is hooked to the scroll bar of the visitor!

 

I’ve placed some comments in your JS to better explain things, please be sure to read through them! Hope it helps and happy tweening! 

 

See the Pen abxdWRP?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Hello Sir , Thank you for the reply and the tips 😊. I had very few knowledge on gsap timeline and I wasn't very sure when and where to use that . Thanks to you now I will read the docs and try to get more info on it . The comments you have provided are very helpful . I am very much new to gsap and I was hard stuck on this . Thanks to you now I will continue with my project . Hope you have an amazing day sir 😊

  • 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.
×
×
  • Create New...