Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在“开始”中更改光标并拖动到上面_Javascript_Css_Html - Fatal编程技术网

Javascript 在“开始”中更改光标并拖动到上面

Javascript 在“开始”中更改光标并拖动到上面,javascript,css,html,Javascript,Css,Html,如何在HTML5中的不同拖放(startDrag和dragOver)事件中更改光标样式 我做了一些测试,但我做不到。有人能帮忙吗,谢谢 const elementDiv1=document.getElementById('div1'); const elementDrag1=document.getElementById('drag1') elementDiv1.addEventListener(“下降”,下降); elementDiv1.addEventListener(“dragover”

如何在HTML5中的不同拖放(startDrag和dragOver)事件中更改光标样式

我做了一些测试,但我做不到。有人能帮忙吗,谢谢

const elementDiv1=document.getElementById('div1');
const elementDrag1=document.getElementById('drag1')
elementDiv1.addEventListener(“下降”,下降);
elementDiv1.addEventListener(“dragover”,allowDrop);
elementDrag1.addEventListener(“dragstart”,拖动);
功能allowDrop(ev){
ev.preventDefault();
}
功能阻力(ev){
ev.dataTransfer.setData(“文本”,ev.target.id);
}
功能下降(ev){
ev.preventDefault();
var data=ev.dataTransfer.getData(“文本”);
ev.target.appendChild(document.getElementById(数据));
}
#第1部分{
宽度:350px;
高度:70像素;
填充:10px;
边框:1px实心#AAAAA;
}
#拖拉{
游标:url(https://i.imgur.com/2Lc66bn.png),汽车;
}


请描述您正在尝试做什么。我们无法读懂你的大脑。我们需要有关您想要实现的目标以及正在发生的事情的信息。也许它可以帮助您:也有人问过类似的问题:也许您可以找到解决方案。更改startDrag和DragOver事件中的光标样式可能重复的请描述您正在尝试的操作。我们无法读懂你的大脑。我们需要有关您想要实现的目标以及正在发生的事情的信息。也许它可以帮助您:也有人问过类似的问题:也许您可以找到解决方案。更改startDrag和DragOver事件中的光标样式可能重复