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

What is Framer? Join the Community
Return to index
Abdou Ghr
Posted Jul 21 - Read on Facebook

Hey folks!
Has anyone seen/downloaded the "draggable-basics" example which was on the website before the new version?
It was very clear - need it for a draggable cards example (Tinder) with x/y limit.


Marc Krenn

Hi Abdou!

Check out this example by Алексей:

layer2.MaxDragFrame = layer1

... is a new, undocumented property that sets a (super)layer as boundary for a draggable layer. Hope that helps.

Abdou Ghr

thanks marc for your help, unfortunately i cannot use it yet as i am working on framer 2 for windows...

Marc Krenn

Since you're using framer2, you should be able to limit the range by using a simple if-condition, like:

rangemin = 0
rangemax = 100
layer.on(Events.DragMove, function() {
if (layer.y > rangemin && layer.y < rangemax) {

Abdou Ghr

perfect! I used an event listener + if-condition but your method seems more relevant ;) grazie

Read the entire post on Facebook