drag&drop not working in Opera 11.62 and Safari 5.1.4

强颜欢笑 提交于 2019-12-25 02:33:21

问题


I put this code in a test HTML file:

<head>
<script>
f=function() {
el=document.getElementById('dragdiv');
el.ondragover=function(){return false;};
el.ondragenter=function(){return false;};
el.ondrop=function(event){ 
el.innerHTML=event.dataTransfer.getData('Text');};
}
</script>
</head>
<body onload='f()'>
<div id='dragdiv'>DROP HERE ------------------------</div>
<img src='image.jpg'></img>

(Tags were removed) It works in Chrome but not in Opera and Safari because the mouse cursor does not change into an arrow like in Chrome. What is wrong with this code in Opera and Safari?


回答1:


Drag and drop support is coming in Opera 12, which is now out in beta. As far as I can tell, it works in the beta release.



来源:https://stackoverflow.com/questions/10411970/dragdrop-not-working-in-opera-11-62-and-safari-5-1-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!