Jump to content
Search Community

Prevent mouse move offset triggering on child

cmc94 test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

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

  • Solution

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

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...