鼠標(biāo)拖拽多次沒(méi)有反應(yīng),但最終都會(huì)有拖拽效果(感覺(jué)就像 拖拽不靈敏)并且在谷歌瀏覽器中拖拽沒(méi)有影子,而火狐有影子。 <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>
HTML5拖拽
慕標(biāo)琳琳
2018-08-20 10:09:45