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

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

My syntax here is wrong, but is something like this possible?

layer.draggable.enabled = true
layer.states.add
----noDrag: { draggable.enabled: false }
layer.on Events.Click, - >
----layer.states.next()

the goal is to toggle the draggable state on a layer on click

4 Comments

Koen Bok

I think you are looking for something like this: http://cl.ly/2A1E000D1z2O

Benjamin Lehn

That works well for the blur property, but I'm not sure about how to create a layer state where draggable is disabled, like:

layer.states.add
----fixed: { layer.draggable.enabled = false }

George Kedenburg III

Benjamin, this is what you're looking for: http://codepen.io/anon/pen/tcgLF?editors=001

George Kedenburg III

It seems simple on paper, but it does require a little bit more logic than you realize, because we need to determine if the user is clicking or dragging. Without that, the initial drag click will reset the draggability.

Read the entire post on Facebook