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

What is Framer? Join the Community
Return to index
Daniel Caine
Posted Dec 16 - Read on Facebook

Hey guys,

Has anyone got a really simple example of moving an elements y position inside of a scrollComponent onTap?

I have a list of images in a scrollComponent, where when they're individually clicked the clicked item will move to the top of the screen. Great, this is what I want. However, it breaks when you scroll. 😕

I've looked at Jay Stakelon's example on the Framer website where he does something similar, but wondering if anyone has a more simple example?

Link to prototype: http://share.framerjs.com/6xthavom0c1w/

Link to Jay Stakelon's example: https://share.framerjs.com/9yvzeghjecdj/

Any help is greatly appreciated

1 Comments

Niels van Hoorn

Hey Daniel, great prototype, and you're almost there :)

The only thing that's missing, is that you need to account for the content offset of the feedScroll.

With our new animation API (https://github.com/koenbok/Framer/wiki/Animation-Upgrade-Guide) it became possible to edit states after adding them, so you can edit the y value of "on" state of the photo just before switching to it.

That's exactly what I did here: http://share.framerjs.com/t28qk8kmz15z/

Hope this makes sense, but let me know if you have any other questions!

Read the entire post on Facebook