我正在尝试在我的应用程序中实现html5的拖放,但Firefox总是被重定向到丢弃图像的源.我正在使用e.stopPropagation().在Chromium中,一切都按预期工作.奇怪......这是代码:
<html>
<head>
<meta charset="utf-8" />
<title>DuOS 0.0.0</title>
<meta name="author" content="Jan Durrer, Michal Gr?o" />
<link rel="stylesheet" href="./default.css" />
</head>
<body>
<script src="./boot.js"></script>
<script src="./window.js"></script>
<script src="./omnibox.js"></script>
<section class="desktop">
<img class="icon" id="computer" style="left: 0px; top: 340px;" src="./image/icon/system/computer.png" />
<img class="icon" id="folder" style="left: 0px; top: 170px;" src="./image/icon/system/documents.png" />
<img class="icon" id="bin" style="left: 0px; top: 0px;" src="./image/icon/system/bin.png" />
</section>
<script>
window.clickedIcons = Array();
window.draggedIcon = {};
window.draggedIcon.offset = Array();
window.draggedIcon.element = null;
//Pohybování
function drag_start(e) {
window.draggedIcon.element = e.target;
event.dataTransfer.effectAllowed …Run Code Online (Sandbox Code Playgroud)