国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - When using H5 drag and drop, why is the dragged element removed?
ringa_lee
ringa_lee 2017-06-22 11:53:56
0
1
1094

1. Please see the phenomenon:
https://codepen.io/xuyu/proje...

2. The effect I want to achieve is to copy the dragged element to the specified area without deleting the dragged element.

ringa_lee
ringa_lee

ringa_lee

reply all(1)
阿神

document.addEventListener("drop", function( event ) {

  // prevent default action (open as link for some elements)
  event.preventDefault();
  // move dragged elem to the selected drop target
  if ( event.target.className == "landingArea" ) {
      event.target.style.background = "";
      //dragged.parentNode.removeChild( dragged );
      $(event.target).append($(dragged).clone().css('opacity', 1))
  }

}, false);

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template