...

View Full Version : Problem with Drag Drop from one region to other



rajesh_yg
12-17-2007, 09:05 PM
I'm trying to use Drag Drop feature. Using simple example given in below site

http://www.skybyte.net/scripts/drag-drop/

I've three Drop zones (Drop1, Drop2 and Drop3).
i) I've DragA in Drop1 zone.
ii) I moved it from Drop1 to Drop2 and Drop3.
It has cloned the child and removed from Drop1 well. iii) When I move from Drop2 to Drop3 it is cloned in Drop2 BUT it is NOT removing the item from Drop2!!!

Can someone please tell me why it is not removing from Drop2 when I try to move it back.

JS is as given below


// FROM DRAG --------------------------
new Drag(''DragA',{ caption: 'moving A'});

// FROM DROP --------------------------
var i=$('Drop1');
new Drop(i,{
accept:'DIV',
caption: 'Location 2 Time 2',
mouseUp: function(d,e){ clone=e.cloneNode(true); e.parentNode.removeChild(e); d.appendChild(clone); }
});

var i=$('Drop2');
new Drop(i,{
accept:'DIV',
caption: 'Location 2 Time 2',
mouseUp: function(d,e){ clone=e.cloneNode(true); e.parentNode.removeChild(e); d.appendChild(clone); }
});

Thanks,
Rajesh

rajesh_yg
12-17-2007, 11:43 PM
Fixed it.. Got the help from support

just removed cloning functions and it works well on IE/Firefox.

Here is where I changed the code:

Before:
mouseUp: function(d,e){ clone=e.cloneNode(true); e.parentNode.removeChild(e); d.appendChild(clone); }

Fixed to:
mouseUp: function(d,e){ e.parentNode.removeChild(e); d.appendChild(e); }



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum