Jump to content
GreenSock

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

Can't overwrite properly on mouseleave

Recommended Posts

Hi!

I'm sorry, but I have some issue with mouseleave,

in demo as you can see image with overlay is not dissapearing,

if I make tl.reverse() on mouseleave everything is fine, but I need my timeline to hide everything immediately.

 

What am I doing wrong?

See the Pen XWmzGYz by ChicagoJostik (@ChicagoJostik) on CodePen

Link to comment
Share on other sites

I've very confused why you are adding the .set()s to the timeline. Why not just use gsap.set()? 

 

However, in this case, all you need to do instead of any .set()s is just tl.pause(0).

 

It'd also be helpful to keep track of the state to know when you should play the timeline.

See the Pen QWjxjjm?editors=0010 by GreenSock (@GreenSock) on CodePen

 

I highly recommend my article on animating efficiently because it covers using control methods :) 

  • Like 1
Link to comment
Share on other sites

@ZachSaucier

Thanks! I tried too much method that even tried to use set()s in timeline,

Even so it doesn't work with gsap.set() too.

Can you try use gsap.set instead of tl.pause(0), please?

 

I can't understand how to make it work with gsap.set().

Link to comment
Share on other sites

12 minutes ago, AslanGoi said:

Can you try use gsap.set instead of tl.pause(0), please?

You really should not be using set calls here. Because they prevent the timeline from functioning again so you'd have to recreate it again. Just use .pause(0).

  • Thanks 1
Link to comment
Share on other sites

14 minutes ago, ZachSaucier said:

You really should not be using set calls here. Because they prevent the timeline from functioning again so you'd have to recreate it again. Just use .pause(0).

Thanks a lot, Zach!!! I really appreciate your help!

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