Jump to content
Search Community

Progress bar with scrollTrigger not working correctly

CamelCase
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

CamelCase
Posted

Hello, 

I need help with an abnormal scrollbar behavior. The gauge teleports in all directions when scrolling instead of scrolling from left to right and vice versa depending on the scroll.

I've put an example of the problem on codepen. 

Have a nice day, 

Laura

See the Pen by pen?template=raNqgdy (@pen?template=raNqgdy) on CodePen.

  • CamelCase changed the title to Progress bar with scrollTrigger not working correctly
  • Solution
mvaneijgen
Posted

Creating a timeline with both your tween on it and then using the position parameter will be much easier for this, then your tween just play at the same time and you don't need to do fancy onUpdate calculations. 

 

Also note if you want no ease you'll set ease: "none", see the see ease visualizer https://gsap.com/docs/v3/Eases/

 

Hope it helps and happy tweening! 

 

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

  • Like 2
CamelCase
Posted

Hello, 

Thanks for your help in synchronizing the two elements with the timeline :)

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