Share Posted April 13, 2016 I've created some morphing icons that morph back and forth with different easing functions on .mouseenter() and .mouseleave() (using jQuery .hover method) I'd like to force the Tween in my hoverOver functions to complete before the hoverOff function is allowed to start. I'm a little stumped on how to achieve this. Can anyone point me in the right direction of how to do this? See the Pen qZoREQ by MandyMadeThis (@MandyMadeThis) on CodePen Link to comment Share on other sites More sharing options...
Share Posted April 13, 2016 Hi mthomson pls tween same property with hover over / out functions , currently you tween progress on over and time on out 3 Link to comment Share on other sites More sharing options...
Share Posted April 13, 2016 Thanks for the demo. Nice effect you have there. I had to cut a bunch of out to help see what was happening. I also made the duration super long for testing purposes. I think fromTo will help a lot here: function hoverOver(){ //put timeline into tween to add easing TweenMax.to(tl, 10, { progress: 1}); } function hoverOff(){ //send tl back to beginning with a differnt easing console.log("off"); TweenMax.fromTo(tl, 0.25, {progress:1}, {progress:0, ease: Power2.easeIn}); } http://codepen.io/GreenSock/pen/zqWwVR?editors=0110 4 Link to comment Share on other sites More sharing options...
Share Posted April 13, 2016 ah, I just saw Diaco's response. Yes, a problem was that while you were tweening time back to 0 the progress was still tweening to 1. Link to comment Share on other sites More sharing options...
Author Share Posted April 13, 2016 Ah! Ok thank you so much for your fast and clear responses 1 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