在 HTML5 拖放中将 'dragImage' 设置为 div 元素时,我遇到了问题。 问题是,当 helper - setDragImage(helper, x, y) 函数的第一个参数未在 dom 中显示或隐藏时,在触发“dragstart”事件时它不可见。 看看我的 fiddle :http://jsfiddle.net/AemN5/10/
In the fiddle I am rendering helper (it's colored into yellow), than try to drag green draggable box, helper is attached to the mouse when drag starts. However, try to click on the button above the helper to hide helper. Than try again dragging green draggable box - no helper is attached to my mouse.
有什么想法为什么会发生这种情况,更重要的是如何解决问题?因为我的主要目标是拥有不可见的助手,并且只有当用户开始拖动时才将其附加到光标上可见。
>最佳答案
这是一种可能的解决方案 http://jsfiddle.net/AemN5/12/
关于javascript - 为什么HTML5拖放dragImage隐藏时不显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10428129/