Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

TimelineLite to method is not working correctly

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.



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

Link to comment
Share on other sites

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

Thank you very much Carl, this is exactly what I wanted it to do.

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