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

What is Framer? Join the Community
Return to index
Joshua Tucker
Posted Oct 14 - Read on Facebook

Hello friends! Pro-tip: instead of writing out each property of a draggable i.e. cell.draggable.[property]., you can set properties just like you would with layer.props. Less writing! Been wanting to do this forever and just thought to use props instead of cell.draggable = {properties}.

Cheers!

5 Comments

Arron J Hunt

But its 1 line of code longer! :P

Jorn van Dijk

But still. I like it!

Jordan Robert Dobson

Nice... it's much more readable that way!

Balraj Chana

Awesome :) I've been doing this for a while although just be careful when it comes to defining the overdrag. The overdrag doesn't work when you define the property as part of .props but it works standalone. Check it out by uncommenting the last line of code here: http://share.framerjs.com/vr54no7w42hu/

Marc Krenn

Ha, that's a lovely idea. Nice work, Joshua!

However, I'm not 100% sold on the syntax used. I'm wondering if the syntax used for "animate" could be adapted for "draggable" to make things a little bit more in-line ( = using a slightly higher number of shorter lines for better readability).

What do you think?

Read the entire post on Facebook