首页 新闻 会员 周边

HTML5拖拽

0
悬赏园豆:10 [已解决问题] 解决于 2018-06-21 00:02
鼠标拖拽多次没有反应,但最终都会有拖拽效果(感觉就像 拖拽不灵敏)并且在谷歌浏览器中拖拽没有影子,而火狐有影子。
 
<style>
 
#dragRegion{
  display:block;
  width:300px;
  height:100px;
  margin:100px;
  background-color:aquamarine;
}
#drag{
  width:100px;
  height:100px;
  float:left;
  background-color:bisque;
}


</style>
 
 
<body>
<box id="dragRegion"></box>
<p id="drag" darggable="ture" ></p>
 
<script>
drag.ondragstart = function () {
  console.log('1')
}
drag.ondrag = function(){
  console.log('2')
}
drag.ondragend = function(){
  console.log('3')
}
dragRegion.ondragenter = function(){
  console.log('4')
}
dragRegion.ondragover = function(e){
  e.stopPropagation();
  e.preventDefault();
  console.log('5')
}
dragRegion.ondragleave = function(){
  console.log('6')
}
dragRegion.ondrop = function(){
  console.log('7')
}
 
 
</script>
doios的主页 doios | 初学一级 | 园豆:4
提问于:2018-06-20 22:34
< >
分享
最佳答案
0

draggable

doios | 初学一级 |园豆:4 | 2018-06-21 00:01
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册