0
我正在學習如何實現拖放操作並具有選擇下拉列表。此下拉菜單顯示了幾個選項,我希望用戶能夠將選項文本拖到另一個框中。bootstrap:如何將文本從下拉列表中選擇
根據this tutorial我所要做的就是set the draggable attribute to true
。
我曾嘗試以下,但拖動似乎不工作:
<div class="container">
<label>My List</label>
<select class="form-control">
{{#each my_list}}
<option value="{{this}}" draggable="true">{{this}}</option>
{{/each}}
</select>
</div>
我也做這個使用jQuery UI試過:
<div class="container">
<label>My List</label>
<select class="form-control">
{{#each my_list}}
<option value="{{this}}" id="draggable">{{this}}</option>
{{/each}}
</select>
</div>
<script>
$("#draggable").draggable();
</script>
任何想法將是最有幫助!