Jump to content
Search Community

Timline ad scrollTrigger

ginphreak test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Hi forum, i have a stupid question, bu i spend much time on it: i want to move a fixed div (a simple square div) on page from center to right and from right to left. But with this code second .to() starts from center and not from last position. Ho can i start from last position? Thank you and sorry for the stupid question.

See the Pen jOdjOZW by gmanzavinoilabsolutionsit (@gmanzavinoilabsolutionsit) on CodePen

Link to comment
Share on other sites

Don't worry about asking any type of question here. We're here to help each other and we all have to start somewhere! There is a logic issue here. A tween on a timeline can not have its own ScrollTrigger only the whole timeline can be controlled by the ScrollTrigger, not individual parts. 

 

Here is your same logic, but combined in to one ScrollTrigger. Its start trigger is your first section and its end trigger is the second section. Hope it helps and happy tweening! 

 

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

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