tags:

views:

34

answers:

1

I have a simple table and draggable div on this table's cells. How can I get the element dragged div stopped on. I need to do this without droppable plugin. Because there are a lot of cell and droppable cause performance decrease. Any help would be appreciated.

A: 

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.

ptrin
Thanks I tried to solve the problem by using coordinates but now there are tons of complexity in the code and coordinates don't match different browsers. It is working on ff, ie8, chrome but ie7 and safari.
jsonx