Jump to content
GreenSock

Separator

Animate array of items based on index

Go to solution Solved by Separator,

Recommended Posts

Hi there,

I edited the codepen therefore also the question. 

Its strange that now the animation happens only on the last item of the array and not on the array im hovering over.  

Any help, please? :)

 

See the Pen zYWwXvL by Separator (@Separator) on CodePen

Edited by Separator
I changed the codepen code
Link to comment
Share on other sites

Anyone that can help me, please?

Link to comment
Share on other sites

  • Separator changed the title to Animate array of items based on index
  • Solution

BTW, i found the solution. 

My mistake was that i was setting `hover` as a global variable. 

I had to set it as const hover = gsap.to... 

so: 

const hover = gsap.to(animateElements, {
		translateY: -15,
		autoAlpha: 1,
		paused: true,
		ease: "power2.inOut",
		stagger: 0.1,
	});

 

  • Like 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.
×