JQuery droppable gets draggable id
I want to get a draggable id when I dropped to a specific div
Drag <ul id="demo" >
<li id="1" ></li>
<li id="2" ></li>
<li id="3" ></li>
</ul>
<div class="drop"> drop here!! </div>
JQuery
$(".drop").droppable({
drop: function(event, ui) {
// i need to get dragged id (note:able to drag multiple ids)
1,2,3..
}
});
Please help me! Thnks
+3
3 answers
As the jQuery UI dropable doc says
All callbacks receive two arguments: the source browser event and the prepared ui object, see below for documentation of this object (if you call your second argument “ui”):
ui.draggable - , jQuery.
ui.helper - , jQuery
ui.position - {top:, left:}
ui.offset - {top:, left:}
ui.draggable - , jQuery object.
, , ui.draggable.prop('id')
+13