Jump to content
Search Community

Strange hover problem

smallio 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

I often use the following to toggle hovers with each functions. 

 

  function inOrOut() {
    tl.reversed() ? tl.play() : tl.reverse();
  }

 

Here the timeline is playing upon reloading the page & then in the wrong direction.  If I start out with the timeline as "reversed: false" it still plays the wrong scaling bigger instead of smaller. I guess it's being triggered somehow before hand & then starting in reverse? 

 

See the Pen wOdvva?editors=0010 by smallio (@smallio) on CodePen

 

 

This pen by @PointC uses the same setup & it works perfectly.  Why is mine glitching back?

 

See the Pen qyREPb by PointC (@PointC) on CodePen

 

Cheers.

See the Pen wOdvva?editors=0010 by smallio (@smallio) on CodePen

Link to comment
Share on other sites

2 minutes ago, PointC said:

You have a typo on paused:


 var tl = new TimelineMax({pasued:true, reversed:false});

 

Fix that and set reversed to true and I think you'll be good to go. :)

 

 

Thanks dude :) was going a bit crazy there.

  • Like 1
  • Haha 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.
×
×
  • Create New...