Jump to content
Search Community

Animating cards on hover. Is this a good use case for the FLIP plugin?

superunknown test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hey everyone. I'm trying to use FLIP to animate these cards on hover, but every example I've seen of the FLIP pluing in action uses an onclick event. Is it a bad idea to use it with a mouseenter event? And what should I use for mouseout in case it's not? Would it be better to just create a timeline and animate that back and forth on mouseenter/out?

 

Basically I wanted to try FLIP because I think it's (maybe?) the only way to smoothly animate the layout changing from flex-direction: column to flex-direction: row on mouseenter, and the elements going from display:none to block. Am I wrong here?

 

Thanks! 

See the Pen MWGvJev by superunknown (@superunknown) on CodePen

Link to comment
Share on other sites

  • Solution

Hi,

 

I don't see any issues with using mouse enter/leave events for triggering Flip animations, they're just events as any others.

 

Here is your example using those events to animate the cards and the target card image as well:

See the Pen NWMLLRX by GreenSock (@GreenSock) on CodePen

 

Let us know if you have any other question.

 

Happy Tweening!

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