Pin depending on scroll direction in GSAP Posted August 12, 2022 I am trying to simulate this sidebar effect but I am not able to do it. Demo: https://somewebmedia.github.io/hc-sticky/demo_1.html If the height of the window is less than the height of the sidebar, when scrolling the sidebar stays sticky at the bottom when scrolling down. However, if you scroll up, the sidebar sticks to the top. With the examples that I have found, the sidebar always stays sticky at the top. Is there a way to make the sidebar sticky up or down depending on the scroll direction?
Pin depending on scroll direction
in GSAP
Posted
I am trying to simulate this sidebar effect but I am not able to do it. Demo: https://somewebmedia.github.io/hc-sticky/demo_1.html
If the height of the window is less than the height of the sidebar, when scrolling the sidebar stays sticky at the bottom when scrolling down.
However, if you scroll up, the sidebar sticks to the top.
With the examples that I have found, the sidebar always stays sticky at the top.
Is there a way to make the sidebar sticky up or down depending on the scroll direction?