I have a page with lots of jquery UI draggables and lots of droppable s. I wanted some kind of user logic to determine if droppable would accept some draggable, so I coded some logic in the "accept" event for droppable . It worked, but one thing I noticed is that this event fires when you start dragging an item and it fires for all droppables at that time.
It seems very inefficient. I thought this would be true for one right right when you hover, but that doesn't seem to be the case. Is there any reason why you think it is encoded in this way (since it seems very inefficient, as if I had 100 droppables, it would fire 100 times, even if the user only tries to drag into one droppable) and also if there is a way there is the behavior that I want.
I was thinking about putting the logic in the drop event in order to do my check and remove the dragged item (to simulate not accepting it), but the problem is that you are not getting any of these nice animations to “return”, so it looks a bit inconsistently (compared to what you see if you use the accept event)
Any thoughts on how I can still plug in some kind of user logic, but not waste cycles to shoot for each individual right when I move something (and still get reverse animation)?
leora source
share