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

What is Framer? Join the Community
Return to index
Edward Sanchez
Posted Aug 23 - Read on Facebook

How do I set a minX and maxX on a draggable layer? It can't be based on the canvas size because the thing being dragged is 4000px long. But I want it to not be draggable past 280 nor past -3720.

4 Comments

Bruno Bergher

In the listener function, just set x to your min if layer.x > minX, and the same for maxX

Seoh Char

http://codepen.io/seoh/pen/dzurm there is `maxDragFrame` in Framer

Edward Sanchez

Just spent like an hour trying all sorts of things and seem stuck. I think the problem is that my bounds are huge and off "canvas" (if there is one). So when I drag near the bounds, I get this jerky movement as though it's trying to stick to it but not happy about it.

When I set an if statement the same thing happens.

I also have a momentum animation on DragEnd which needs to respect these bounds.

Edward Sanchez

I got it working with an animate to get rid of the shakies. http://www.codeshare.io/G9npE

Read the entire post on Facebook