可拖放、可排序
我是 JQuery 新手...... 最近我正在做一个项目,我遇到了以下问题:
我有两个 ul (例如:画廊(LHS)和垃圾(RHS))。
在画廊中我有 8 里,它们是可拖动和可排序的。 我可以将 li 拖放到垃圾箱中。我什至可以将它们分类到垃圾桶中。
我面临的问题是这个李的放置 实际上,最初垃圾箱是空的,但有一个背景图像,其中有 8 个矩形框,每个矩形框都有一个序列号。(请注意.. 8 个矩形框只是一个图像)。
因此,每当我将第一个 li 放入垃圾桶时,第一个矩形框就会隐藏在 li 后面。当我放下第二个框时,第二个框会隐藏,依此类推......
现在我希望当我将第一个李从画廊拖到第八个矩形时。垃圾箱停留在那里,而不是向上移动,因为它是一个单一的容器。
有人建议我使用 8 个不同的容器。但问题是我能让这个 8 个容器可排序吗? 我需要一个可拖动、可放置的特定容器,以及该 8 个容器内的可排序 li。
I am new to JQuery....
Recently i was working on a project and i faced the following problem:
I have two ul (say: gallery(LHS) and trash(RHS)) .
In gallery i have 8 li's and they are draggable and sortable.
I can drag and drop the li's to trash. I can even sort them in trash.
the problem i am facing is with the placement of this li's
Actually, initially the trash is empty but has a background image with 8 rectangular boxes and each rectangular box has a serial number in it.(mind it.. the 8 rectangular boxes are merely a single image).
So whenever I drop the first li into the trash, the first rectangular box hides behind the li. when I drop the second one, the second box hides and so on.....
Now i want that when i drag the first li from gallery onto the 8th rect. box of the trash it stays there instead of moving upwards as it is a single container.
Someone suggested me to use 8 different containers. But the problem is can i make this 8 container sortable.
I need a draggable,droppable on a particular container and sortable li's within that 8 container.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
按照建议,您可以使用 8 个不同的容器。然后,当用户将某些东西放到容器 8 上时,您可以将要排序的值放入容器中。然后,当用户想要排序时,对这8个容器进行排序。
如果这还不够清楚,也许可以发布一些(简化的)代码,我会看看是否可以帮助您。
You could work with 8 different containers, as suggested. Then when the user drops something on container 8, you could put the value on which you want to sort, in the container. Then, when the users wants to sort, sort the 8 containers.
If this isn't clear enough, maybe post some (simplified) code, and I'll see if I can help you out.