jQuery-UI 可拖动和可排序
所以我一直在使用这个示例: http://jqueryui.com/demos/draggable/#sortable 我已经在我的产品上完成了它。然而我想做两个重大改变。
我不希望第二个列表(在我的示例中为 toList)可以自行排序。我只希望它接受第一个列表(在我的示例中为 fromList)中的项目。
当用户从第一个列表(fromList)拖动一个项目并将其放入第二个列表(toList)时,我希望该项目被强制到底部。
建议?这是我迄今为止所拥有的一个工作小提琴。 http://jsfiddle.net/CrtFD/
So I've been working with this example: http://jqueryui.com/demos/draggable/#sortable and I've accomplished it on my product. However I want to make two significant changes.
I don't want the second list(toList in my example) to be sortable on it's own. I only want it to accept items from the first list(fromList in my example).
When a user drags an item from the first list(fromList) and drops it into the second list(toList) I want that item to be forced to the bottom.
Suggestions? Here is a working fiddle of what I have so far. http://jsfiddle.net/CrtFD/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试为您的 toList 使用 droppable:
编辑: 根据以下评论:
< a href="http://jsfiddle.net/abzYK/" rel="nofollow">http://jsfiddle.net/abzYK/
Try using a droppable for your toList:
EDIT: Per comments below:
http://jsfiddle.net/abzYK/
您希望您的 toList 是可删除的,而不是可排序的。此示例似乎描述了您想要完成的任务: http://jqueryui.com/demos/可丢弃/#shopping-cart
You want your toList to be Droppable, not Sortable. This example seems to describe what you are trying to accomplish: http://jqueryui.com/demos/droppable/#shopping-cart