Jump to content
Search Community

Reposition animation on screen resize

Caroline_Portugal test
Moderator Tag

Go to solution Solved by PointC,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hey guys, 

 

In this pen I have 4 elements that are animated diagonally around the screen. On resize I'd like the elements' position to be reset. I tried to do that on line 35, but it isn't working. 

 

Any suggestions on how I might achieve this?  

 

Thank you so much for your help, 

 

Caroline

 

(GSAP's code is from line 1-63)

See the Pen yJGVWm?editors=1010#0 by carolineportugal (@carolineportugal) on CodePen

  • Like 1
Link to comment
Share on other sites

Hey Carl, 

 

Thanks so much for getting back to me. I have spent quite some time on this but still not getting what I want (I am sorry, I am poorly alphabetized in JS). I have tweaked your pen to show you what I'm trying to do. It's basically a timeline with an object moving after the other object is finished moving. This works fine until the screen is resized. 

 

After a few screen resizes it all gets buggy, with objects moving at various times, not when the other is finished. Not sure what else to try.

 

Thanks so much again for your help, 

 

See the Pen LkraEx?editors=0010 by carolineportugal (@carolineportugal) on CodePen

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