Jump to content
Search Community

Sticky column with observer on text that are in viewport

AntonioNB4 test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

When using GSAP I would let GSAP handle the animation you want and not try adding classes, much easier to manage. 

 

Is something like this what you're looking for? I would just create a ScrollTrigger for each piece of text and just play or reverse the animation one the different callbacks onEnter, onLeave, ect read more https://gsap.com/docs/v3/Plugins/ScrollTrigger/ be sure to tweak the start and end values so that is triggers exactly when you want. 

 

Hope it helps and happy tweening! 

 

See the Pen rNRgdWq?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen

Link to comment
Share on other sites

28 minutes ago, mvaneijgen said:

When using GSAP I would let GSAP handle the animation you want and not try adding classes, much easier to manage. 

 

Is something like this what you're looking for? I would just create a ScrollTrigger for each piece of text and just play or reverse the animation one the different callbacks onEnter, onLeave, ect read more https://gsap.com/docs/v3/Plugins/ScrollTrigger/ be sure to tweak the start and end values so that is triggers exactly when you want. 

 

Hope it helps and happy tweening! 

 

 

 

I think yes :)) is there the possibility to exclude the first text from blur ?

Link to comment
Share on other sites

1 hour ago, mvaneijgen said:

Of course! Just use the CSS selector to :not select the first one 

 

Great! It works.... I noticed that the blur effect on text doesn't kick in on the first scroll (on the initial page load), but it activates if you scroll back and then scroll down again. What could be the reason for this?

Link to comment
Share on other sites

I don't know what the question is. ScrollTrigger works with the start and end markers, when the green markers touch the onEnter fires, when the red markers touch the onLeave fires. See the docs onEnter, onEnterBack, onLeave, onLeaveBack https://gsap.com/docs/v3/Plugins/ScrollTrigger/ The toggleActions are a short hand for that, so if you want things to happen in another order or you want things to happen at other triggers you have to update the toggleActions or the start  and end makers so they suite your project. 

 

If you still have questions please fork one of the demo's and show us what you've tried and explain what things are doing now and what you want them to do, that way we can help you debug. Hope it helps and happy tweening! 

Link to comment
Share on other sites

11 minutes ago, mvaneijgen said:

I don't know what the question is. ScrollTrigger works with the start and end markers, when the green markers touch the onEnter fires, when the red markers touch the onLeave fires. See the docs onEnter, onEnterBack, onLeave, onLeaveBack https://gsap.com/docs/v3/Plugins/ScrollTrigger/ The toggleActions are a short hand for that, so if you want things to happen in another order or you want things to happen at other triggers you have to update the toggleActions or the start  and end makers so they suite your project. 

 

If you still have questions please fork one of the demo's and show us what you've tried and explain what things are doing now and what you want them to do, that way we can help you debug. Hope it helps and happy tweening! 

I know how scrollTrigger works.... In my CodePen, the texts right after the first one don't trigger unless they already have the default blur effect. This happens on the first scroll when the page is loaded. However, if you go back, activating the toggle action, this doesn't happen, and everything is perfect. Maybe there's some modification needed on the toggle action? Or do I need to set the default blur myself with .set?

See the Pen BabeVvj by Antonio-Nocella (@Antonio-Nocella) on CodePen

Link to comment
Share on other sites

  • Solution
2 minutes ago, AntonioNB4 said:

Or do I need to set the default blur myself with .set?

If you want things to have the blur on page load, yes.

 

Right now the animation only triggers if the green and red markers touch. Another way of going about it would be to blur everything on page load and change animation to un-blur something if ScrollTrigger onEnter fires. But that is up to you and what is the best fit for your project. Hope it helps and happy tweening! 

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