Jump to content
Search Community

bit of a beginner question - how to move object up then down

Bee test
Moderator Tag

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

I am trying to move a div square for example up using this....

 

TweenMax.to(".surprise-card", 1, {delay: 1.2, ease: Power4.easeOut, y: -500});

 

Then I want to move it back down over something (so changing the zIndex) but it over writes the previous command, which it's supposed to do but I'm not sure how to make this work.

 

Cheers,

 

Bee

Link to comment
Share on other sites

Hi @Bee :)

 

Welcome to the forum.

 

I'm not sure what you mean by overwriting the previous command? To answer you question, you can change the zIndex and make one element higher/lower than another. Here's a basic example:

See the Pen xLOKXm by PointC (@PointC) on CodePen

If you have other questions, a CodePen demo is the way to get the best answers. Here's some info about that:

Happy tweening.

:)

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