Jump to content
Search Community

Timeline reverse animation

Hector18 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

Hi,

 

I have this timeline function on next slide click event from my slider:

 

var tl = new TimelineLite();    
                        
var tl = new TimelineLite();
    $('.content1').find('.box').each(function(index, element) {
        tl.to(element, 0.5, {scale:0.9, x:100, opacity:0, ease:Power2.easeInOut}, index * 0.02)
    });

 

What I want to achieve is on prev slide click event is the timeline animation to start form the last element and end to first element. How can I do this?

 

Thank you!

See the Pen QZQabv by Hector18 (@Hector18) on CodePen

Link to comment
Share on other sites

HI @Hector18,

 

As @mikel said it makes things far more clear if we can see a CodePen example of the issue.

 

Are you looking for GSAP's reverse() functionality? https://greensock.com/docs/TweenMax/reverse()

 

From the look of things, you might be best using GSAP's StaggerTo functionality https://greensock.com/docs/TweenMax/static.staggerTo() too.

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