【发布时间】:2016-03-27 00:22:44
【问题描述】:
我正在编写一个脚本,我在拖放列表项时遇到问题。当我将项目拖放到可放置区域时,事件会触发两次。这是我的代码。在此处查看代码
$('.draglist div').draggable({
cursor: 'move',
helper: 'clone',
connectToSortable: '.droplist'
});
$(".droplist").droppable({
drop: function (event, ui) {
var dragtext = $(ui.draggable).text();
alert(dragtext);
}
});
$('.droplist').sortable({
opacity: 0.6,
revert: true,
cursor: 'move',
placeholder: "highlight",
});
【问题讨论】:
标签: jquery jquery-ui draggable jquery-ui-draggable