Jump to content
GreenSock

momo12

Hover runs for all elements

Go to solution Solved by Carl,

Recommended Posts

Hi

I have a list of similar items but

 

1- my code is not able to target each block individualy to change the mask scale. Can someone help me?

2- Is a way to fix the hover problems? I mean re-hover or something runs the animation twice! "play none none none" works here?

See the Pen vYrdYJq by emdesigner-or (@emdesigner-or) on CodePen

Link to comment
Share on other sites

  • Solution

thanks for the simple demo.

my jQuery is a bit rusty, but I recall that hover would handle 2 functions for mouseenter and mouseleave.

The biggest issue is that you are creating a new timeline on every hover.

I don't really know what the end result is but usually it is best to create the timeline once for each element and then control it differently for each mouseevent. 

 

hopefully the following can get you going in the right direction.

 

See the Pen VwdQYRb?editors=0110 by snorkltv (@snorkltv) on CodePen

 

"play none none none" looks like toggle actions for ScrollTrigger and wouldn't apply at all here.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, Carl said:

thanks for the simple demo.

my jQuery is a bit rusty, but I recall that hover would handle 2 functions for mouseenter and mouseleave.

The biggest issue is that you are creating a new timeline on every hover.

I don't really know what the end result is but usually it is best to create the timeline once for each element and then control it differently for each mouseevent. 

 

hopefully the following can get you going in the right direction.

 

 

 

 

"play none none none" looks like toggle actions for ScrollTrigger and wouldn't apply at all here.

Thanks a lot for your answer and solution!!!

  • Thanks 1
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.
×