Share Posted April 1, 2020 HI. Could you please help me with processing an animation when putting a pointer on and off the imgBoxOne block? The problem is the next: mouseenter and mouseleave are conflicting when putting the pointer on and off the block too fast. Is that possible to make them wait for each other somehow? Actually, these functions are conflicting with each other. (mouseenter =>animaBoxOneFirst , mouseleave => animaBoxOneReverse)https://codesandbox.io/s/sad-meitner-ucpfy bandicam 2020-04-01 23-49-11-536.mp4 See the Pen by s (@s) on CodePen Link to comment Share on other sites More sharing options...
Share Posted April 1, 2020 Hey Roman. By default, GSAP does not kill off tweens that affect the same properties of the same objects. If you want that to happen, you should set overwrite: 'auto' (or true) for the tweens that conflict. Alternatively, change the property globally: gsap.defaults({overwrite: 'auto'}); However, in your case it might make more sense to setup a timeline for the hover transition when the JS is initialized. Then on mouseenter you play it, on mouse leave you reverse it. 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