Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Any tips on making the following option elements draggable?

<select id="expenseSelect" multiple="multiple" style="height:200px">
    <option value="a">aaaaaaaa</option>
    <option value="b">bbbbbbbb</option>
    <option value="c">cccccccc</option>
    <option value="d">dddddddd</option>
    <option value="e">eeeeeeee</option>
</select>

The following doesn't seem to work

$(document).ready(function() {
    $('#expenseSelect').children().draggable();
});

I'm basically looking for a listbox element where the user can choose 1 or more items and drag them to a form.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
538 views
Welcome To Ask or Share your Answers For Others

1 Answer

Faced with this problem, and wrote a small jQuery plugin for that. Only problem is Internet Explorer (any) - it not support any events on <option> element.

https://github.com/NikitaKA/jquery.dragOptions


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...