【发布时间】:2012-12-01 23:56:52
【问题描述】:
我想将已删除的项目附加到可排序列表中的目标可放置框中,但我无法将已删除的项目附加到特定元素中。
我的 jquery,
$(".sortable").sortable({
update: function(){
// php update.
}
}).disableSelection();
$( ".droppable" ).droppable({
activeClass: "ui-state-hover",
hoverClass: "ui-state-active",
drop: function( event, ui ) {
var targetElem = $(this).attr("id");
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped! inside " + targetElem );
alert(targetElem);
var container = $( this ).find( "ul.dropped-items" ).css({border:"blue solid 1px"});
container.append(ui.draggable.clone());
ui.draggable.remove();
}
});
被丢弃的项目应该附加到这个元素中,
<ul class="dropped-items">
</ul>
但这只是没有发生。我错过了什么,我该如何让它发挥作用?
【问题讨论】:
-
对我来说很好。
li附加到ul。这不是你想要的吗? -
我这边还是没有运气。是的,我想要
li appended to the ul。谢谢。 -
你用的是什么浏览器?
-
也适合我。我认为由于位置是绝对的,您可能只是看错了。
-
已附加。也许您在谈论样式问题
标签: php jquery jquery-ui jquery-ui-sortable jquery-ui-droppable