Jump to content
Search Community

Two-part Boxed Slider Reveal

BradC28 test
Moderator Tag

Go to solution Solved by Carl,

Recommended Posts

Hi all,

 

I'm building a boxed reveal effect very similar to the example shown here 

See the Pen YzrwEXm by GreenSock (@GreenSock) on CodePen

 but it has two separate parts: one container for text and one container for images. Both sections should scroll up and down together as the images will support the copy.

 

I've tried to use the position parameter to match up these two sections on scroll but haven't nailed it down yet. The red box does not match up with the second text panel. I feel like it's close but need some help bringing it over the finish line. Any help is appreciated. Thank you!

See the Pen QWzEjXa by bcerwin (@bcerwin) on CodePen

Link to comment
Share on other sites

Thank you! Appreciate the quick response.

 

Now that it's working I see the snap property needs some adjustment. What am I missing there? After the initial scroll, there is some gap between the slides if you allow to snap into place. Obviously it is then in the correct position at the end of the timeline. Thanks again! 

 

Link to comment
Share on other sites

  • Solution

so in the previous version you'll notice that you have to scroll a bit before the next section slides up.

 

This means that there was some dead space in the beginning of the timeline.

 

Since the loops were skipping the first panels when i === 0 then that means the first elements to be animated were being inserted at a time of 0.5 from the (i * duration) position parameter.

 

We want the first position parameter to be zero so we can just use

 

(i-1) * duration

 

See the Pen QWzEKbm?editors=0010 by snorkltv (@snorkltv) on CodePen

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