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

What is Framer? Join the Community
Return to index
Logan Merriam
Posted Feb 04 - Read on Facebook

Got a draggable element, and on DragEnd i'd like it to figure out if it's near one of the little dropzones below it and land in that dropzone instead of returning to it's original spot. I know a couple really crappy ways I could pull it off, but would like to understand the right way. Thoughts?

6 Comments

Andreas Wahlström

Here's one way you could do it: http://codepen.io/aw2/pen/zxrzje

Logan Merriam

hey that's really awesome! i'd still like the draggable element to return to it's origin if it's not within a few px of one of the dropzones though.

Andreas Wahlström
Logan Merriam

yeah between the two examples i think i can figure it out

Logan Merriam

thanks!

Jason Ogle

Awesome Andreas, was looking for something like this, thanks!

Read the entire post on Facebook