dragging multiple list items simultaneously

守給你的承諾、 提交于 2019-12-11 12:52:59

问题


I have two lists connected with jQuery UI's sortable, allowing to drag items from one list to another.

http://jsbin.com/uraga3

Is there a simple way to drag several items at the same time - e.g. to move items #3, #4 and #7 from left to right?


回答1:


Not in the plugin.

You can write some custom code to add items to a selection and then move multiple at once.

Like:

$( "li" ).bind( "click", function() {
  $(this).toggleClass('sorting-selected');
});

$( "ul" ).bind( "sortreceive", function(event, ui) {
  $('li.sorting-selected').appendTo($(this));
});


来源:https://stackoverflow.com/questions/3104961/dragging-multiple-list-items-simultaneously

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!