Jump to content
Search Community

Code for working with parallax on attributes with multiple elements and triggers

TomTim test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

  • Solution

Hi @TomTim welcome to the forum!

 

You'd defined a timeline outside everything and add all the tweens to a that timeline then on scroll of the ScrollTrigger it would play all the tweens of the one timeline and then quickly reset it for the next timeline. If you scope the timeline to the current loop (and the ScrollTrigger to) everything works as expected. 

 

This is all built in to ScrollSmoother https://gsap.com/docs/v3/Plugins/ScrollSmoother/, if you're are looking for a robust implementation of this function. 

 

Hope it helps and happy tweening! 

 

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

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