views:

3522

answers:

2

At the moment I have a set of divs, generated dynamically by php and all having their ids starting with 'itembox', with a count number appended. I have a droppable garbage bin area on the page so that the user can delete an individual itembox by fdragging and dropping on to the bin.

My problem is that the droppable won't seem to activate when I drag the original, while it will function (perfectly) when I have helper: 'clone' set. Unfortunately, though, when dragging, the cloning function takes its clone from the first iteration of the itembox, no matter which itembox is actually dragged.

So I'm looking for a solution to either make the droppable accept an original or force the cloning function to take its clone from the itembox actually dragged.

(sorry, can't post any code right now as am on work computer).

Thanks

+1  A: 

I guess the problem must lie in the accept option of your droppable initializer. Just try the following:

$('#mydroppable').droppable(
{
    accept: function() { return true; },
    drop: function () { alert("Dropped!"); }
});

Now this will accept everything, so you should probably implement some filtering in the accept function but none the less this should work.

DrJokepu
A: 

Thanks DrJokepu.

I seem to have solved the problem by setting the tolerance on the droppable element to 'pointer'.

Tim Sewell