Jump to content
Search Community
ericshew 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

Hi there,

 

I'm running into some challenges in using the hover with morphSVG plugin. What I'm trying to do is to have an object morph from shape to shape on the basis of what menu item is currently hovered over.  I'm sure I'm overlooking something basic. Thank you in advance for your help. Thanks!  

See the Pen mprRPR by ericshew (@ericshew) on CodePen

Link to comment
Share on other sites

Hi @ericshew :)

 

The most noticeable problem is line 19.
 

//Switch this
tl.reversed() ? tl.play() : tl.reversed();

//to this
tl.reversed() ? tl.play() : tl.reverse();

 

That should get everything working for you. It can certainly work with playing and reversing the timelines like that, but you'll see some harsh morph jumps when hovering on/off quickly between <li> tags. You could get some smoother morphs with rapid hovering like this:

 

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

Just my two cents worth. Hopefully that helps. Happy tweening.

:)

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