jquery - draggable
I have a simple table and draggable div on this table's cells. How can I get the element dragged div stopped on. I ne开发者_如何学运维ed to do this without droppable plugin. Because there are a lot of cell and droppable cause performance decrease. Any help would be appreciated.
I have the answer to half of your problem... If you look at the Draggable docs, you'll see that start, drag and stop events are triggered.
$('.element').draggable({
axis: 'y',
containment:'parent',
stop: function(event,ui)
{
console.log(ui);
}
});
If you use the stop event as above, inside that callback function you can access ui.offset to get the mouse coordinates where the drag ended. From there, I don't know how you could figure out which element those coordinates are 'on top of', though.
精彩评论