创建新的 droppable 时 JQuery UI Droppable 被销毁
好的,我在页面上有一个简单的可放置内容。当用户执行操作时,会运行一个函数并创建一个新的 droppable。现在原来的 droppable 不再起作用了。它起作用的唯一方法是,如果可删除项都具有相同的类名,但是如果我在原始文件中删除某些内容,它会认为我将其删除到创建的新文件中。如果我尝试对 droppables 使用唯一的名称,则只有最后创建的 droppable 有效,之前的任何其他 droppable 都无效。这似乎是一个简单的问题,但我还没有找到任何相关内容。
Okay, I have a simple droppable on the page. When the user performs an action, a function is run and it creates a new droppable. Now the original droppable doesn't work anymore. The only way it will work is if the droppables all have the same class name, but then if I drop something in the original, it thinks I dropped it in the new one that was created. If I try to use unique names for the droppables, only the last droppable to be created works, any others beforehand do not. It seems like a simple issue, but I haven't been able to find anything on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请看看下面的小提琴: http://jsfiddle.net/eykgb/
您必须与两者,类和 ID 来激活所有可拖放对象并了解您的可拖放对象被拖放到哪一个上。
please have a look at the following fiddle: http://jsfiddle.net/eykgb/
You have to work with both, classes and IDs to active all droppables and to know on which one your draggable was dropped.