...

View Full Version : Issue with scriptaculous custom onDrop in IE



WiglyWorm
08-10-2009, 07:42 PM
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* as planned in firefox.

ohgod
08-10-2009, 08:10 PM
i hit an odd issue with drag\drop having issues in IE after a few. maybe 12-15 drap\drops and it would stop working until the page reloaded. never really found a good explanation.

WiglyWorm
08-10-2009, 08:58 PM
More info: Using more primitive debugging techniques, the error seems to be in the line " element.parentNode.removeChild(element);" commenting this out allows the rest of the code to function, but leaving it in throws an error of "object expected", it's hard to tell more without a debugger.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum