如何獲取可丟棄元素的ID,何時丟棄物品?在這裏我使用jquery ui和asp.net mvc。jquery ui獲取可丟棄元素的ID,當丟棄物品
<table id="droppable">
<tr>
<td style="width:300px;height:50px">Backlog</td>
<td style="width:300px;height:50px">Ready</td>
<td style="width:300px;height:50px">Working</td>
<td style="width:300px;height:50px">Complete</td>
<td style="width:300px;height:50px">Archive</td>
</tr>
<tr id="cart">
<td id="BackLog" class="drag" style="width:120px;height:50px;">
<img class="draggable" id="1234" src="../../Content/themes/base/images/ui-icons_222222_256x240.png" />
</td>
<td id="Ready" class="drag" style="width:140px;height:50px">
</td>
<td id="Working" class="drag" style="width:140px;height:50px">
</td>
<td id="Complete" class="drag" style="width:140px;height:50px">
</td>
<td id="Archive" class="drag" style="width:140px;height:50px">
</td>
</tr>
}
</table>
在這裏,我想將圖像移動到其他列,並獲得該列的ID。 拖放我使用腳本
<script type="text/javascript">
$(function() {
$(".draggable").draggable({ containment: '#imageboundary', axis: "x" });
$("#droppable").droppable({
drop: function (event, ui) {
$.ajax({
type: "POST",
url: '/Project/AddToPhase/' + $(ui.draggable).attr("id") ,
success: function (data) {
$('.result').html(data);
}
});
}
});
});
</script>
謝謝..我們需要更多解釋 – user685254 2011-04-06 09:07:28