[英]how can I make the elements in a jQuery UI sortable container be freely draggable?
Basically, I want to be able to freely drag items in a container and leave them at whatever position I desire.. However, if there are two items touching each other, dragging the one on the right towards the one on the left should cause the two to swap positions (hence sortability)... 基本上,我希望能够自由拖动容器中的项目并将它们放置在所需的任何位置。.但是,如果有两个项目彼此接触,则将右侧的项目拖向左侧的项目会导致两个交换位置(因此可排序)...
However, if I do: 但是,如果我这样做:
container.sortable({axis: 'x'});
item_1.draggable({axis: 'x'});
item_2.draggable({axis: 'x'});
container.append(item_1);
container.append(item_2);
then they are not sortable, just draggable... How can I accomplish this? 那么它们就不能排序,只能拖动...我该如何完成?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.