Jump to content
Search Community

TimelineLite to method is not working correctly

sick911 test
Moderator Tag

Go to solution Solved by Carl,

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 have been using greensock for a content slider that has 3 buttons, each related to the div holding the content, I've been using timeline lite for the animation, I first click the button the animation works like it should it translates the values I'm giving it, but when I click the button for a second time the divs holding the content don't translate anymore. I have taken screenshots for what's happening, one of them is what is happening in the DOM after i press the button for a second time, and the other is my code, I was following this tutorial http://www.youtube.com/watch?v=4DMzlkmcZCw

 

I appreciate in advance the help.

 

Thank you.

post-43169-0-66284100-1459538251_thumb.png

post-43169-0-16345900-1459538263_thumb.png

See the Pen pyPLvj by alvaro911 (@alvaro911) on CodePen

Link to comment
Share on other sites

  • Solution

Hi and welcome to the GreenSock forums,

 

Thanks for posting the demo.

 

It seems you were missing some code in the following function

 

function goToTile(sildeIn, slideOut){
tl = new TimelineLite();
tl.set(slideIn, {x:'200%', autoAlpha:1, className:'+=active'})
.set(slideOut, {className: '-=active'})
.to(slideOut, 0.5, {x:'200%', ease:Power3.easeInOut}, 0)
.to(slideIn, 0.75, {x:'-=200%', ease:Power3.easeInOut}, 0);
}
 
 
I think that should do what you want. 
  • 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...