0
$(".target").droppable({
connectWith: ".connected",
drop: function (event, ui) {
var targetId = event.target.id;//--> id of the target (where elements will be dropped into)
var orderId;//--> id of the dragged element (NOT the targetId)
if ($(this).hasClass("source connected")) {
orderId = sourceElementSo;
}
else {
orderId = $(ui.draggable).attr("id");
};
我試過ui.item和ui.draggable,但沒有成功如何在目標排序後收到拖動項目的類別?
PS:新手:)
$(本).hasClass(「源連接「) –
Thx @VladuIonut,但仍然無法正常工作! –
你可以提供更多的細節或代碼的小提琴嗎? –