I fixed the issue. The trick is to set the html body element as a
droppable.
Droppables.add('body',{accept:'dragme',onDrop:dropBody});
function dropBody(dragged, dropped, event)
{
dropped.appendChild(dragged);
}
And add the ID to the body tag:
<body id="body>
On Nov 18, 12:27 pm, Jason Whitmer <[email protected]> wrote:
> I have several draggables and several droppables on the page. Using
> script.aculo.us, I have the ability to put draggables into droppables.
> I'm using this code for the onDrop to achieve this:
>
> function drop(dragged, dropped, event) {
> dragged.style.top = 0;
> dragged.style.left = 0;
> dropped.appendChild(dragged);
>
> }
>
> Now I need to remove draggables form droppables. I want to be able to
> visually drag a DIV out of a droppable and have it remove it from the
> droppable's child array and back into the body element.
>
> My guess is the draggable's onEnd event could trigger this, but I
> don't know how to get this to work.
>
> Thank you,
> Jason
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=.