回答編集履歴
2
セミコロンが残ってたので
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
this.textContent='Drag: (' + String(e.pageX) + ',' + String(e.pageY) + ')'
|
10
10
|
|
11
|
-
}
|
11
|
+
}
|
12
12
|
|
13
13
|
function handleDragOver(e) {
|
14
14
|
|
@@ -22,13 +22,13 @@
|
|
22
22
|
|
23
23
|
return false;
|
24
24
|
|
25
|
-
}
|
25
|
+
}
|
26
26
|
|
27
27
|
function handleDrop(e) {
|
28
28
|
|
29
29
|
this.textContent='Drop: (' + String(e.pageX) + ',' + String(e.pageY) + ')'
|
30
30
|
|
31
|
-
}
|
31
|
+
}
|
32
32
|
|
33
33
|
document.querySelectorAll('.column').forEach(col => {
|
34
34
|
|
1
loadイベントに変えたときにうっかり汚染してたので
test
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
|
5
5
|
window.addEventListener('load', e =>{
|
6
6
|
|
7
|
-
t
|
7
|
+
function handleDragStart(e) {
|
8
8
|
|
9
9
|
this.textContent='Drag: (' + String(e.pageX) + ',' + String(e.pageY) + ')'
|
10
10
|
|
11
11
|
};
|
12
12
|
|
13
|
-
t
|
13
|
+
function handleDragOver(e) {
|
14
14
|
|
15
15
|
if (e.preventDefault) {
|
16
16
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
};
|
26
26
|
|
27
|
-
t
|
27
|
+
function handleDrop(e) {
|
28
28
|
|
29
29
|
this.textContent='Drop: (' + String(e.pageX) + ',' + String(e.pageY) + ')'
|
30
30
|
|
@@ -34,11 +34,11 @@
|
|
34
34
|
|
35
35
|
col.setAttribute('draggable', 'true');
|
36
36
|
|
37
|
-
col.addEventListener('dragstart',
|
37
|
+
col.addEventListener('dragstart', handleDragStart, false);
|
38
38
|
|
39
|
-
col.addEventListener('dragover',
|
39
|
+
col.addEventListener('dragover', handleDragOver, false);
|
40
40
|
|
41
|
-
col.addEventListener('drop',
|
41
|
+
col.addEventListener('drop', handleDrop, false);
|
42
42
|
|
43
43
|
});
|
44
44
|
|