SteveS Posted September 18 Share Posted September 18 I'm creating a section on a site where when the user clicks on a "bubble" it animates to a different container using FLIP. It works beautifully by itself, but when I apply a hover effect to the bubbles, it instead snaps to the new container instead of animating. I saw this thread which seems somewhat close to the issue I'm having, but I can't really identify what is causing my problem. See the Pen WNLoXLw by StevenStavrakis (@StevenStavrakis) on CodePen Link to comment Share on other sites More sharing options...
mvaneijgen Posted September 18 Share Posted September 18 Hey @SteveS long time no see! This is not the correct setup, but why not add another element to the mix and do your hover animation on that, that way you're not fighting tweens that want to animate the same element. See the Pen qBLPMzm?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen Link to comment Share on other sites More sharing options...
SteveS Posted September 18 Author Share Posted September 18 Yeah, I had to take a break and focus on some other stuff. Life is strange. I considered doing something like this where instead I wrap each "orb" in a container and animate that container. It's not impossible, but it doesn't help me understand what is happening. My basic understanding of FLIP would seem to indicate that it should work. Or, at least, that it shouldn't break specifically in the way it is breaking. Link to comment Share on other sites More sharing options...
Solution SteveS Posted September 18 Author Solution Share Posted September 18 Yeah, I rectified the issue by adding the mouse movement effect to a wrapping element and then moving the orb in and out of it. Problem solved. I'm still not completely sure what the issue was but it's a fine enough solution. Link to comment Share on other sites More sharing options...
GreenSock Posted September 18 Share Posted September 18 Yeah, Flip uses x/y transforms to do its magic, but you had a "mousemove" handler that was simultaneously trying to control the same properties, animating them to completely different positions. You created conflicting tweens. Make sense? Link to comment Share on other sites More sharing options...
SteveS Posted September 18 Author Share Posted September 18 I see. It wasn't snapping, it was just putting in the mouse directed transform. Makes sense. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now