cmc94 Posted April 19, 2023 Share Posted April 19, 2023 Hi there! I'm brand new to GSAP and I'm having trouble with an image I'm trying to display on hover. The mouse move offset seems to be triggering when hovering over my child elements and not just the parent div. I've added a link to Codepen with the first example being my error, the second being how I want it to appear (but with the child elements appearing like the first example). Is there a way to exclude the child elements on mouse move? Would be very grateful for any help! Thanks so much. See the Pen dygpvvv by carly-mcintyre (@carly-mcintyre) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted April 19, 2023 Solution Share Posted April 19, 2023 Hi @cmc94 welcome to the forum! I would give all the elements pointer-events: none; In my example everything has this, so the book now button is also not clickable, so I would move that outside or make the whole thing clickable. Hope it helps and happy tweening! See the Pen yLRavqM?editors=0100 by mvaneijgen (@mvaneijgen) on CodePen 2 Link to comment Share on other sites More sharing options...
cmc94 Posted April 19, 2023 Author Share Posted April 19, 2023 @mvaneijgen Brilliant, what a lovely simple solution! Thanks so much for your quick response - this works perfectly. 😊 3 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