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

What is Framer? Join the Community
Return to index
Fran Pérez
Posted Jun 27 - Read on Facebook

I was helping a friend with a project and thinking that this would probably be useful to others as well, so here it is: super simple sticky header inside a scroll component :)

http://share.framerjs.com/cke5lnwtthwd/

3 Comments

Jordan Robert Dobson

#framerCode

Chase Curry

Nice job- what's the significance of "else HEADER_POS"? I wouldn't have thought to include it

Fran Pérez

It's just a condensed way of writing this:

if scroll.scrollY >= HEADER_POS
header.y = scroll.scrollY
else
header.y = HEADER_POS

HEADER_POS is just a constant with the Y position of the header :)

Read the entire post on Facebook