Jump to content
Search Community

Make 2 divs meet on Scroll

jbanj test
Moderator Tag

Recommended Posts

Hi,

 

I have not been able to find an example to what I am trying to achieve but hopefully I can explain it well.

 

I am trying to animate two images in separate divs to meet at the center of the main div (not overlap) on scroll. One image comes from top, the other comes from the bottom of the screen.

 

Thanks. 

Link to comment
Share on other sites

I'm afraid we don't have capacity to just build custom solutions for people here. (see the forum guidelines)

 

However we're more than happy to help if you've attempted it and got stuck.

 

There are lots of examples in the docs! Here's a little starting point.

 

let tl = gsap.timeline({
  scrollTrigger: {
    trigger: containerElement,
  }
})

tl.from(image1,{yPercent: -100})
tl.from(image2,{yPercent: 100}, 0)

 

  • 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.
×
×
  • Create New...