Jump to content
Search Community

restart method question

ifgetdollardie 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

Hey there! I'm a mugiwara as you can see :D 

 

I'm learning this awesome tool for build animations.

 

I'm getting stuck with restart method. It works as I expect in all buttons except the first one. (Screenshot attached to understand better) and there is the code: http://simulador.96.lt/

 

I used it bad? I hope you can help me.

 

And nice to meet you ofc! ?

 

 

Screenshot_1.png

See the Pen by (@) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

I took a look at your site. I'm really not sure how I'm supposed to interact with it or what the desired behavior is. Also I don't know where I'm supposed to find your JavaScript. 

 

It would really help if you could create a reduced test case as described here:

 

Thanks!

  • Like 2
Link to comment
Share on other sites

Hello Carl,

 

I can create a codepen demo, but the problem is that it works perfectly:

 

See the Pen NOraLP?editors=0010 by ifgetdollardie (@ifgetdollardie) on CodePen

 

This is how my site it should works, but the "first button" doesn't. There is no error in the console log. Maybe I'm not using well fromTo/to methods. I don't know... ^^'

 

If you wanna check my original javascript, you can see it doing: right button > inspect element > sources > main.js

 

Thanks for your time! ?

 

Link to comment
Share on other sites

Hey there! Finally I fixed it using whatevertimeline.kill(); instead of whatevertimeline.invalidate().restart(); 

 

But still don't know why the other timelines have different behaviour :o! (I'll keep investigating)

 

Edit1:  whatevertimeline.invalidate().totalTime(0); works instead of whatevertimeline.invalidate().restart(); and better than kill() everything and everybody :P

 

I'll keep ... :D

Link to comment
Share on other sites

  • 4 weeks later...

Good morning! How are you? I hope you are fine! Do you remember this pen: 

 

See the Pen NOraLP?editors=0010 by ifgetdollardie (@ifgetdollardie) on CodePen

I've another question about it and maybe you can help me! I wish that when you click "next" button the animation goes directly to the next label, without finish the current animation.

 

 What do you think about that? It could help to avoid overlap? What I pretend is fix the behaviour of the click. Now when you click, nothing happen until the current label animation has been finished.

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