質問編集履歴
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
img.src="https://freesvg.org/storage/img/thumb/Poppies.png";
|
22
22
|
img.addEventListener('load', function(){
|
23
23
|
setInterval(function(){
|
24
|
-
console.log(this.id);//今
|
24
|
+
console.log(this.id);//今setInterevalをloadしている対象オブジェクトがimage0/image1かを出力したいがthisでは参照できない
|
25
25
|
console.log(image1.id)//こういう指定方法はなしで
|
26
26
|
},1000);
|
27
27
|
});
|
1
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
img.src="https://freesvg.org/storage/img/thumb/Poppies.png";
|
22
22
|
img.addEventListener('load', function(){
|
23
23
|
setInterval(function(){
|
24
|
-
console.log(this.id);//image0
|
24
|
+
console.log(this.id);//今動いてるimage0/image1を出力したいがthisでは参照できない
|
25
25
|
console.log(image1.id)//こういう指定方法はなしで
|
26
26
|
},1000);
|
27
27
|
});
|