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

What is Framer? Join the Community
Return to index
Giel Cobben
Posted May 25 - Read on Facebook

Hey guys, just a quick question: Is it posible to use the scrollToPoint function with negative numbers? When I do this:

list.scrollToPoint(
‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍y: -200
‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍true
‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍curve: "ease"
)

It just scrolls to 0 not -200.

3 Comments

Koen Bok

scrollToPoint clamps the point automatically to be in bounds: https://github.com/koenbok/Framer/blob/master/framer/Components/ScrollComponent.coffee#L322

You can get around it by setting the scroll.content.y directly, but strange things might happen :-)

What is your specific use case? Maybe I should change the behavior.

Mårten Björk

Here's a demo of the solution that Koen suggested: http://share.framerjs.com/j6wsjwpkmw4b/

Giel Cobben

Thanks for the replies :)

The list needs to start at half the screen size. The list is scrollable but when you click on the list it has to move all the way down. I've added an image and a link to the prototype: http://share.framerjs.com/iaegd1nr0jed/

Read the entire post on Facebook