質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
```ここに言語を入力
|
56
56
|
|
57
|
-
|
57
|
+
リアルタイムに1個づつ色が変わる、という動きにならない・・・
|
58
58
|
|
59
59
|
|
60
60
|
|
@@ -68,11 +68,21 @@
|
|
68
68
|
|
69
69
|
|
70
70
|
|
71
|
-
|
71
|
+
const d1 = new Date();
|
72
72
|
|
73
|
-
while
|
73
|
+
while (true) {
|
74
74
|
|
75
|
+
const d2 = new Date();
|
76
|
+
|
77
|
+
if (d2 - d1 > 1000) {
|
78
|
+
|
75
|
-
|
79
|
+
break;
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
76
86
|
|
77
87
|
});
|
78
88
|
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -47,3 +47,59 @@
|
|
47
47
|
<div>10</div>
|
48
48
|
|
49
49
|
```
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
```ここに言語を入力
|
56
|
+
|
57
|
+
ダメコード
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<script>
|
62
|
+
|
63
|
+
window.onload=function(){
|
64
|
+
|
65
|
+
Array.from(document.querySelectorAll('div'), item => {
|
66
|
+
|
67
|
+
item.style.background="red";
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
var waitUntil = new Date().getTime() + 1*1000;
|
72
|
+
|
73
|
+
while(new Date().getTime() < waitUntil)
|
74
|
+
|
75
|
+
true
|
76
|
+
|
77
|
+
});
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
</script>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<div>1</div>
|
86
|
+
|
87
|
+
<div>2</div>
|
88
|
+
|
89
|
+
<div>3</div>
|
90
|
+
|
91
|
+
<div>4</div>
|
92
|
+
|
93
|
+
<div>5</div>
|
94
|
+
|
95
|
+
<div>6</div>
|
96
|
+
|
97
|
+
<div>7</div>
|
98
|
+
|
99
|
+
<div>8</div>
|
100
|
+
|
101
|
+
<div>9</div>
|
102
|
+
|
103
|
+
<div>10</div>
|
104
|
+
|
105
|
+
```
|