e 1 an în urmă
părinte
comite
373f1a4cd6
3 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      JS初级/DOM/13.拖拽.html
  2. BIN
      JS初级/DOM/images/6.jpg
  3. BIN
      JS初级/DOM/images/7.jpg

+ 3 - 3
JS初级/DOM/13.拖拽.html

@@ -26,8 +26,8 @@
             var left1 = event.clientX - box.offsetLeft;
             var top1 = event.clientY - box.offsetTop;
             box.onmousemove = function(event){
-                box.style.top = event.clientX - top1 + 'px';
-                box.style.left =  event.clientY - left1 + 'px';
+                box.style.top = event.clientY - top1 + 'px';
+                box.style.left =  event.clientX - left1 + 'px';
 
             }
         }
@@ -36,4 +36,4 @@
         }
     </script>
   </body>
-</html>
+</html>

BIN
JS初级/DOM/images/6.jpg


BIN
JS初级/DOM/images/7.jpg