I am implementing a "drag & drop" functionality inside of a small webpage, however, I am having an interface issue.
Whenever I attempt to drag an element that has its draggable property set to true, the browser displays a blocking-icon next to the element.
Below is an image that helps to demonstrate the issue:
Does anyone know how to change that icon, or is it UN-resolvable?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
#dropzone {
background-color: #eee;
border: 1px dashed #aaa;
max-width: 200px;
padding: 100px;
-webkit-user-drag: auto;
}
.draggable {
width: 100px;
height: 50px;
background-color: burlywood;
border-radius: 10px;
margin: 20px;
line-height: 50px;
text-align: center;
}
</style>
</head>
<body>
<div></div>
<div id="dropzone">
<p style="text-align: center;"><b>Dropzone</b><br>Drag anything over here</p>
</div>
<div class="draggable" id="o1" draggable="true">Object 1</div>
<div class="draggable" id="o2" draggable="true">Object 2</div>
<script>
window.ondragstart = function(e) {
e.dataTransfer.setData('text/plain', e.target.id);
}
var dropzone = document.querySelector('#dropzone');
dropzone.ondragover = function(e) {
e.preventDefault();
}
dropzone.ondrop = function(e) {
// this.innerHTML = '';
this.appendChild(document.getElementById(e.dataTransfer.getData('text/plain')));
}
</script>
</body>
</html>
