【发布时间】:2017-10-19 07:33:17
【问题描述】:
工作演示: http://jsfiddle.net/PWh2L/78/
$( ".droppable,.droppable1" ).sortable({
connectWith: '.droppable,.droppable1',
revert: 200,
tolerance:'pointer',
start: function(){
},
stop: function(event,ui){
if ($(ui.item).hasClass('number1') && $(ui.item).parent()[0].id==="main_list" && $(ui.placeholder).parent()[0] != this) {
$(this).sortable('cancel');
}else if ($(ui.item).hasClass('number2') && $(ui.item).parent()[0].id=="main_list1" && $(ui.placeholder).parent()[0] != this){
$(this).sortable('cancel');
}
},
zIndex: 10
}).droppable({
drop: function(ev, ui) {
}
});
上面的链接是我的代码,我遇到了一个问题,就是当我将 element (testinggggg) 从 B 拖到 C ,然后我尝试将元素(testingggg)从C拖到A,然后它会自动回到C,但是当元素(testinggg)回到C时,它会在顶部修复它,我想要的是每个元素都回到C它会出现在Name:C下方,这意味着Name:C会将它固定在上面。
请指教。 :(
【问题讨论】:
标签: javascript php jquery