Jump to content
Search Community

Animate a child element on a forEach iteration

Pata test
Moderator Tag

Recommended Posts

I want to animate an element and its child on a forEach. I don't know how to point to that element on my GSAP line.

 

Many thanks in advance,

 

elements.forEach((e) => {
e.addEventListener('mouseover', function() {
gsap.to(e, {y: 100})
gsap.to(**CHILD ELEMENT OF e**, {y: -100})
})
})
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...