I have an unordered list <ul>
with list items <li>
which I'd like to be able to "reorder" via dragging. I'm using jQuery. How could I accomplish this? I tried hooking into the click event but I can't get the drag to work right (I want the other <li>
elements to move out of the way once I drag an <li>
element over a suitable spot so the user can see where it would end up).
Help?
If you don't need to invent the wheel:
Have you considered jQuery UI's droppable/draggable functionality?
Here's a link to a ul demo.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.