electerious / basicScroll

Standalone parallax scrolling for mobile and desktop with CSS variables.
https://basicscroll.electerious.com
MIT License
3.63k stars 148 forks source link

Is there a way to do pinning to another container/element like scrollmagic does? #51

Closed adrianocr closed 4 years ago

adrianocr commented 4 years ago

See this demo: https://scrollmagic.io/examples/basic/simple_pinning.html

I have a hero image section that has a secondary image right below it. I need for that secondary image to slowly move up into the hero section and then pin itself at the bottom edge when it reaches it. I'm not seeing an how I'd achieve that with basicScroll

electerious commented 4 years ago

There's no pinning feature in basicScroll, but it should be possible to change the CSS position or other properties to get a sticky element. You can try to use the callback functions for this.