jQuery 拖放多个选择框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4661420/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 17:39:49  来源:igfitidea点击:

Drag and Drop Multiple select boxes

jqueryjquery-ui

提问by Elitmiar

I have two multiple select boxes. I need to use JQuery to drag selected items from one combobox to the next. Is this at all possible?

我有两个多选框。我需要使用 JQuery 将选定的项目从一个组合框拖到下一个。这是可能吗?

I need to drag items from this box

我需要从这个框中拖动项目

     <select id="select1"  multiple=multiple> 
<option  value="1">test1</option> 
<option  value="2">test2</option> 
<option  value="3">test3</option> </select>

to this box

到这个盒子

<select id="select2" multiple=multiple>
<option value="4">test4</option>
</select>

Any pointers help will be appreciated

任何指针帮助将不胜感激

回答by Elitmiar

What I did was use the JUI sortable JQuery plugin and that worked for me as I wanted it to.

我所做的是使用 JUI 可排序的 JQuery 插件,这对我有用。

http://jqueryui.com/demos/sortable/#empty-lists

http://jqueryui.com/demos/sortable/#empty-lists