问题标签 [jquery-droppable]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
drag-and-drop - 使用jquery easyUI右键单击上下文菜单和DragnDrop
我已经为 Treegrid 集成了 jQuery easyUI 插件(可编辑和拖放功能)。所有功能都已成功实现。有一个特点是“当用户右键单击它应该完成的”自定义上下文菜单“,但同时如果用户右键单击并拖动该行,那么它应该允许用户在 treegrid 中放置同一行。
在我的情况下,当我使用左键单击时它允许,但是当我尝试右键单击并拖动时 - 没有任何反应,它只会向我显示放入的行的“ContextMenu”。
如果有人知道解决方案,请尽早告诉我。
jQuery EasyUI 1.4.2
treegrid.js
treegrid-dnd.js
这些是已经集成的jquery。
jquery - 使用 jQuery UI 拖放到目标区域后克隆可拖动
我希望一些图像尽可能多次地落在目标区域。但图像仅下降一次。我的 jQuery UI 代码:
请在此处查看演示:jsFiddle 示例
从示例中您可以看到图像仅在第一次出现在 div 区域中。但我希望用户能够在目标区域中多次拖放相同的图像。
因此,例如,用户可以拖放图像 5 次,目标区域将克隆5 个图像。我怎样才能做到这一点?
jquery - 使用 jQuery UI 添加另一个图像后删除克隆的图像
我之前的问题有一个很好的解决方案,可以在删除后成功克隆图像。
这是代码:
但问题是我想在目标区域一次只显示一张图像。但目前显示所有丢弃的图像。
更具体地说,当用户将图像放置在目标区域中并随后拖动另一个图像时,应从放置或目标区域中删除先前的图像,并且仅新图像应在目标区域中可见。请参阅此演示:jsFiddle 示例
我该如何解决这个问题?
javascript - 缩放容器的jquery可拖动包含数组值
如果有人可以帮助我弄清楚如何使 div 中包含的可拖动元素根据窗口大小改变比例,我将非常感谢任何指导。
如果我做:
会发生什么是它给了我容器的常规大小的容器。因此,如果我有一个transform: scale(1.5)
,容器中将有可拖动元素无法进入的空间。
我也尝试过containment: 'parent'
,但这很容易出错。
编辑
我已经找到了如何获得顶部和左侧的遏制,但我不知道如何获得右侧和底部。
我已经尝试过宽度和高度,containmentArea[0].getBoundingClientRect()
但这似乎也不是正确的举动。
jquery - Having problems with draggable clone object
I am digging from past 5-6 hours and really in trouble . I am facing issues with draggable
objects . What I am trying is I have a popup that is containing 18 small draggable divs . I need to drag one by one those draggable items from the popup and drop it to my document body . The popup is not a bootstrap one which actually freezes everything in the document unless you don't close it . So it's a simple popup . What I have tried so far is this :-
It is creating clone successfully , even I am able to drag the clone object as well . But the moment I drop it to the divGeneralLayOutContentBody
(this is my entire document id) , the clone object appends at the wrong positions . I cannot even see them sometimes but I can do see them in the DOM when I open my debugger tool .
One thing more , I have some applied css to the draggable items . I have set the top
and left
to the draggable items in order to have them properly aligned in the popup . I am not sure whether this is causing issue with the clone as when i create clone then obviously it also has the same css applied . But that too changes when I go on dragging my clonee object .
Any help would be much appreciated .
This is the popup I am talking about . You can see the draggable items 1,2,3,...18
jquery - 可以将 jQuery 嵌套可排序列表中的项目放入可放置部分吗?
我有一个可排序的页面列表,我希望能够在其中一个页面被拖入可放置的“删除”部分时调用一个函数。这可能吗?
javascript - 拖放 - 元素不会掉落
我正在做一个拖放测验这是完整的代码
最初在数字数组中曾经是数字并且它工作正常但是当我将数字更改为图片时,我可以拖动它们但我无法放在正确的位置,比如..它们是可拖动的但不可丢弃!我没有触摸代码我只更改了数组和循环以显示图片,有人知道该怎么做吗?
这是 style.css 文件
该代码最初用于数组中的 10 个元素,请帮助
jquery - 如何确保每个可拖动元素都已使用 jQuery droppable 删除
我正在制作一个带有拖放系统的网页。
- 我有一个包含 3 个按钮的列表,每个按钮都是可拖动的,并且可以放入一个数组中。
- 在这个数组中,TDS 是可放置的,可以接收来自上一个列表的按钮,或者已经放置在数组中的按钮(在列之间切换)。
- 该列表也是可放置的,用于重置按钮的位置,因此仅适用于来自数组的已放置按钮。
一切正常,现在我想知道这 3 个按钮是否已放入数组中以使用户能够进入下一步。
我有一个强烈的印象,拖动的元素在被拖放并传递到drop事件时被克隆。被删除的元素仍然存在于初始列表中(来自 DOM PoV),但也已经存在于数组中(来自 DOM PoV)
这是测试它的代码,console.log 查看元素编号:
根据我的测试:
当我将一个按钮从列表移动到数组时,在 drop 事件结束时,DOM 仍然看到列表中剩余 3 个按钮,但已经看到 1 个按钮被丢弃在数组中 --> 计算剩余按钮不是解决方案确保剩余 0 个元素
当我在两列之间切换按钮时,它使 DOM 认为在 drop 事件中还有一个按钮(在从原始位置删除按钮之前将按钮克隆到新位置)--> 也不是一个好的解决方案
那么我能做些什么来确保我所有的可拖动元素实际上都放在了我的数组中呢?
提前致谢 !
朱利安 Q.