【发布时间】:2013-03-05 05:35:22
【问题描述】:
所有,我知道我们可以实现对元素的可拖动,只需在 jquery ui 中调用 .draggable 方法。
这是一个例子,包括连接到可排序的。
$(".draggable").draggable({
helper : function(){
//return something dom.},
cursor : 'move',
connectToSortable : '.sortableLayoutSection'});
$(".sortableLayoutSection").sortable({
appendTo : parent,
containment : "parent",
cursor : "pointer",
placeholder : 'li-placeholder',
forcePlaceholderSize : false
});
但我的问题是,我怎么知道可拖动项目真的落入指定的容器中(在本例中是类名为.sortableLayoutSection 的元素)?谢谢。
更新
$(".sortableLayoutSection").sortable({
appendTo : parent,
containment : "parent",
cursor : "pointer",
placeholder : 'li-placeholder',
forcePlaceholderSize : false,
receive: function( event, ui ) {alert('ok.got something.')}
});
【问题讨论】:
标签: jquery jquery-ui-sortable jquery-ui-draggable