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

What is Framer? Join the Community
Return to index
Jon Arnold
Posted Jun 10 - Read on Facebook

What is the best way to make a ScrollComponent stop scrolling at a certain scrollY and make it stick to fixed value? I want to build a pull-to-refresh animation with the ScrollComponent

10 Comments

Anton Jarl

This works:

Scroll.on Events.Move, ->
if Scroll.scrollY > 500
Scroll.scrollY = 500

Jon Arnold

tried this, but what if i do this in the negative direction? It always snaps back to zero

Jon Arnold

scroll.on Events.Scroll,->
if scroll.scrollY <= -200
scroll.scrollY = -200

Anton Jarl

First, you need Events.Move

Jon Arnold

I want to build a pull-to-refresh animation

Jon Arnold

For negative values it doesn't work Anton Jarl

Anton Jarl

Nope, needs some more stuff. Hang on.

Jonas Treub

You'll still need to add the animation but here is a start: http://share.framerjs.com/839675za732z/

Anton Jarl

Exactly. The problem with using .Move is that it fires all the time. As Jonas said, it's better to use the onScrollEnd.

The next thing is to animate the whole scroll component down, also in Jonas' example!

Jon Arnold

Yes, that will do :-) thank you!

Read the entire post on Facebook