views:

28

answers:

1

jQuery 1.3 jQuery UI 1.7.2

I have an application where there are a number of droppable divs that accept only a single draggable. I do this by setting the accept option on all my droppable's to a function that check for a valid draggable and if it is already occupied. If it is occupied, the accept fuction returns false, else it returns true. Thus if a user tries to drop a draggable on a droppable that is already occupied, the draggable reverts.

What I would like to do is provide additional feedback when a user drops a draggable on top of an occupied droppable. Any idea how I can do this?

Thanks, ~Matt

A: 

Why not do this with a class? Set the parent item with the class 'full' when you drop the dragged element. Then you could do something like:

if($this).hasClass('full'))
    //Alert user it is full
Baloneysammitch
The problem is I need to make this check when the draggable is not accepted and dropped over an occupied droppable. The accept option of droppable, when given a function, will fire on mouse move for all droppable's so that's no good and the drop event of droppable will only fire if accepted.What I need to do is take action when the draggable is not accepted and dropped over a droppable that is occupied.
m4olivei