I am working on improving a drag and drop implementation by creating an indicator (a silhouette of the draged element) that moves along a set flex grid as you drag and move through the grid. In the current implementation the dragged element in place and when I drop on the drop target it updates the flex order. What I am looking to do is hide the element completely to give a better visual cue as to where the element will be placed. The problem is if I hide the element on drag start, the drag workflow ends abruptly, not even triggering the subsequent drag operations.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
If I understand your question correctly you want to hide the element being dragged during the drag operation. This can be accomplished by hiding the element when the dragover event is fired. Here is an example:
JSFiddle (Drag the orange box)
Javascript:
HTML:
CSS: