I’m attempting to modify the scriptaculous drag/drop behavuior so that when I drag an icon into a droppable, it makes a copy (same ID, class, etc) in the droppable, and removes the original.
Here is the function I came up with to put in the onDrop parameter of my droppables:
[CODE]
function DropHandler(element,el){
var newnode = document.createElement(‘img’);
var classname = element.className;
newnode.src=”img/”+element.id+”.jpg”;
$(el).appendChild(newnode);
newnode.setAttribute(“class”, classname);
newnode.setAttribute(“className”, classname);
debugger;
element.parentNode.removeChild(element);
newnode.id = element.id;
new Draggable(newnode.id,{revert:true});
}
This code works perfectly in firefox, but in IE, after you drop it will continuously place a copy of the draggable elements onmouseup to whatever droppable my mouse happens to be over at the time of my mouseup.
After a while it stops, but all my draggables are broken and do not work.
This especially puzzling because it works *perfectly