Share Posted October 17, 2018 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 More sharing options...
Share Posted October 17, 2018 Hi @Hector18, Your case reduced in a CodePen would be helpful to understand what you want. Best regards Mikel Link to comment Share on other sites More sharing options...
Share Posted October 17, 2018 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. 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2018 Hi, See the Pen QZQabv by Hector18 (@Hector18) on CodePen Just created a pen. For Second row I want animation to start first from box number 6, not from box number 1 like in the first row. Thanks Link to comment Share on other sites More sharing options...
Share Posted October 17, 2018 @Hector18 Is this what you'd be looking for? I simplified the animation to use StaggerTo as well, so that you could see that functionality. See the Pen XxZVoQ by elegantseagulls (@elegantseagulls) on CodePen 5 Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2018 How can I do with 2 timelines, like in my example? Thank you! Link to comment Share on other sites More sharing options...
Share Posted October 17, 2018 Hi, like this ... See the Pen bmLLNM by mikeK (@mikeK) on CodePen Happy tweening ... Mikel 6 Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2018 Thank you guys very much! Link to comment Share on other sites More sharing options...
Share Posted October 17, 2018 Rereading your question, I think @mikel had a better understanding of what you were asking for. I updated my Pen as well. On the StaggerTo, the last value (0.1 and -0.1), in this case, dictates which direction the StaggerTo happens. See the Pen XxZVoQ?editors=0010 by elegantseagulls (@elegantseagulls) on CodePen 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2018 Yes, this is the right solution for my project 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now