This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Arthur Kocharyan
Posted Oct 20 - Read on Facebook

Hello, everyone! I’ve faced a problem which I’m not quite sure how to solve. You see, I’m trying to make header stick to the top of the screen or un stick from it if scroll reaches certain point. The problem is that it does so only if I scroll slowly. I use onScroll -> if screen.scrollY > 500 stick it to the top if <500 then un stick it. Now I tried print: screen.scrollY and it seems that if I swipe up quickly the scroll-by-inertia effect starts and it doesn’t count as scroll, because the print stops the count right were, to my eye, scroll-by-inertia starts. Any way to solve this?


Benjamin Den Boer

Hiya Arthur Kocharyan — this is possibly solved by using "onMove" instead of "onScroll". :-)

Arthur Kocharyan

Thank you, Benjamin Den Boer! In that case, I suppose, I would have to use offset. Am I right?

JL Flores Mena

Sticky headers are very tricky, I created a module for that. Hope this helps!

Arthur Kocharyan

Hey, JL Flores Mena! Great idea to turn this into a module. I would definitely try it!

Read the entire post on Facebook