Is it possible to get the underlaying element of an dragged element?
My specific task is to drag a td
element. If the dragstop event is fired I want the underlaying element. The underlaying element is also a td
.
How could I achiev this?
Here is my HTML code:
<table class="grid">
<tr>
<td class="value" colspan="4"></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
The jQuery part is here:
$('.value').draggable({
cursor: "move",
containment: ".grid",
snap: "td",
start: function(event, ui) {
console.log("start", event, ui, $(this));
},
stop: function(event, ui) {
console.log("stop", event, ui, $(this));
}
});
If I drag the td
with the class value
and I stop dragging I want the td
element under the value element.
Thanks in advance.