modularorg/modularjs

Toggle visibility on scroll

ronca85 opened this issue · 1 comments

Hello!

I am trying to figure out how to use the modules effectively. There's one feature on this website that's puzzling me: http://boyntonyards.com/

The Expolre Somerville button is fixed on the screen. It hides when I scroll down, closer to the footer. I wanted to see how this was done because it would be nice to have control over any element if needed. In chrome's insepctor sources panel I was searching for StickyCtaToggler and there's almost nothing in the hide() function. I don't even see where the hide function was called. The "enter" that's in the hide function - where does it come from? I assume the setInView function dispatches dispatchCall and sticks the enter value somehow but I can't figure out how to use calls to create a similar trigger animation. I was hoping I could do this elegantly but I ran out of ideas.

Thanks

hum-n commented

Hey, it's probably done with Locomotive Scroll data-scroll-target.
You can also do it with modularScroll data-scroll-call.