Jump to content
Search Community

Fixed section with blending content on scroll

AlesS test
Moderator Tag

Recommended Posts

Hello, at first I am sorry to use the forum as non skilled. And now to my scenario. I just don't know where should I start. 

I have my header and first section on the website. In this section, I want to have:
 

  • Heading
  • Button
  • Button
  • Image

 

These should be visible when user open the website. When user start scrolling, then I want to change the content slowly (not parallax but some kind of blending) to the: 

 

  • Heading 2
  • Button
  • Image

 

After that, I would like to scroll normally to the other sections on the page.

 

I want to do it slowly for image and faster for Heading and buttons.

heaven-animation.thumb.png.13892f1a8a97ab431f6f296a8670e829.png

 

As I read some documentation, I already know I should use ScrollTrigger somehow and propably a pinning. 

 

I am completely new and my english is not so good. Can anyone help me plese? Thank you very much!
 

 

See the Pen rNpEPZj by alkokod (@alkokod) on CodePen

Link to comment
Share on other sites

Welcome to the forums @AlesS

 

I would recommend starting out by solving the animation first. Once your animation like you want, then all you have to do is hook it up to a ScrollTrigger and you should be good to go.

 

I'm assuming you're trying to do a crossfade, so you'll probably need to absolute position the second section over the first section. Then use a Timeline and the position parameter to do your fading.

 

If you get stuck along the way, just a post a demo of your work and we nudge in the right direction.

 

  • Like 4
Link to comment
Share on other sites

Hello @OSUblake. I have figured out the crossfade (propably). I have edited the Codepen. I am not sure if my hack with z-index is needed, but I added it because the absolute section was flashing over the first one.

Did I do that right? What should I do next?  Hook the Scrolltrigger to it, can you point me little bit please? I really appreciate your help.

 

Link to comment
Share on other sites

Instead of messing with the z-index, you can animate autoAlpha instead of opacity. It's just like opacity except that when it is at 0, it will set the visibility to hidden. That means you click your first panel while the second panel is hidden.

 

So now you just need to hook it up to ScrollTrigger. I added some empty .set() tweens in there just to add a little gap in between each section's animation. 

 

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

 

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...