Share Posted February 25, 2016 Hi, I am trying to get the animation to play back to its original position when the cursor leaves the button. Thanks in advance. See the Pen GZKrOj by anon (@anon) on CodePen Link to comment Share on other sites More sharing options...
Share Posted February 25, 2016 Hey @struthyBhoy, you should try defining your timeline outside of the hover() function, and then using jQuery's .mouseenter() and .mouseleave() instead of hover(). In those event handlers you can then play() or reverse() your timeline Link to comment Share on other sites More sharing options...
Author Share Posted February 25, 2016 Thanks Acccent - I will play about with that solution. Will prob take me a bit of time - I am no expert with javascript Link to comment Share on other sites More sharing options...
Share Posted February 25, 2016 If you're having trouble, have a look at See the Pen EKYWja by Acccent (@Acccent) on CodePen , but I'd suggest trying to figure it out on your own first 3 Link to comment Share on other sites More sharing options...
Author Share Posted February 25, 2016 Thanks very much - I will give it half an hour on my own before cheating Thanks again. 1 Link to comment Share on other sites More sharing options...
Author Share Posted February 25, 2016 I almost got there although I was missing the {paused:true} and the wipeAnimationHover bit of wipeAnimationHover.to(".device-ipad.client-sssc", 0.7, { x: "-30%", ease: Power4.easeOut, }) Thanks. 1 Link to comment Share on other sites More sharing options...
Share Posted February 25, 2016 You're welcome! Don't forget to mark the thread as answered if you don't have any other questions Link to comment Share on other sites More sharing options...
Share Posted February 25, 2016 Hello struthyBhoy, and Welcome to the GreenSock Forums! Just a quick observation guys.. When using the GSAP timeline, either TimelineMax or TimelineLite. You don't have to use the delay property on your tween since GSAP provides the position parameter http://greensock.com/position-parameter .to( target, duration, vars, position ) This way you get full control over your timeline sequence 2 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