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

What is Framer? Join the Community
Return to index
Patrick Hansen
Posted Dec 06 - Read on Facebook

Does anyone know if there is a way to detect scroll direction (up or down)? Like calculate velocity, but with a scroll event instead of drag?

2 Comments

Seoh Char

how about this

prev = layerA.scrollX
layerA.on Events.Scroll, ->
__if prev < layerA.scrollX
____print "left"
__else
____print "right"
__prev = layerA.scrollX

Patrick Hansen

nice! Looks like that is working. I wasn't setting the "prev" variable again at the end in my last attempts, so it wasn't updating correctly. Thanks Seoh Char !

Read the entire post on Facebook