craigrush — 2012-10-01T08:46:29-04:00 — #1
Having read through the first few chapters of the jquery Novice to Ninja book, and borrowing heavily from a tutorial from elated(dot)com, I am trying to create a drag and drop page, whereby a draggable element reverts to its start point if not dropped in an appropriate area, but snaps to that area if correct. I seem to have this behavior working ok.
What i would like to do is remove the successfully dropped element and have it revert to its original position, if the user subsequently decides to remove it.
Grateful for any pointers / advice
paul_wilkins — 2012-10-03T04:11:48-04:00 — #2
The way that I would do it, is when the stop even if fired (dragging has stopped) I would check if the element is in an appropriate area, and if not I would set the revert option on the element which will return it back to it's home area. The drag event could then remove that revert option from whatever it's dragging too.
craigrush — 2012-10-04T15:43:15-04:00 — #3
Thanks for the reply - still a bit of a noob with jquery. Will take a look and try and work it out
craigrush — 2012-10-12T06:36:38-04:00 — #4
After playing about with this for a day or two, I changed tack and have started working with sortable, which seems to work better for me.