Jump to content
Search Community

Mouseover SplitText Problem

Anatole Touvron
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

Anatole Touvron
Posted

Hi, 

 

I am having some issue. I want to trigger an animation with SplitText (that I will do later) when I have my mouse over the div that contains the word of my nav. But when I target the word's container and that my mouse is over the word, it targets each letter and consider that the mouse is not over the div. (We can see it in the console). 

 

Could you help me ? 

 

Thanks ! 

See the Pen ExaoRbW by Anathug (@Anathug) on CodePen.

  • Solution
Posted

Hey Anatole and welcome to the GreenSock forums! Thanks for being a Club GreenSock member.

 

The easiest way to fix this is to disable pointer events for the children of the element that you have the mouseover event for. You can do that in this case by setting pointer-events: none; on .linkcontainer. Alternatively, you could apply it to .link > * instead.

 

Side note: I recommend looping through each navigation item to apply the animation and mouse enter/exit events, but I assume you know how to do that :) 

  • Like 2
Anatole Touvron
Posted
28 minutes ago, ZachSaucier said:

Hey Anatole and welcome to the GreenSock forums! Thanks for being a Club GreenSock member.

 

The easiest way to fix this is to disable pointer events for the children of the element that you have the mouseover event for. You can do that in this case by setting pointer-events: none; on .linkcontainer. Alternatively, you could apply it to .link > * instead.

 

Side note: I recommend looping through each navigation item to apply the animation and mouse enter/exit events, but I assume you know how to do that :) 

Thanks a lot !!! 

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...