admin管理员组文章数量:1301596
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 acplish 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?
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 acplish 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?
Share asked Jul 25, 2010 at 19:03 AlexAlex 77.4k91 gold badges265 silver badges350 bronze badges2 Answers
Reset to default 7If you don't need to invent the wheel:
http://jqueryui./demos/sortable
Have you considered jQuery UI's droppable/draggable functionality?
Here's a link to a ul demo.
http://jqueryui./demos/draggable/#sortable
本文标签: jQueryJavaScript Reorder Unordered List via DraggingStack Overflow
版权声明:本文标题:jQueryJavaScript: Reorder Unordered List via Dragging - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741661058a2391040.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论