teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

テキスト修正

2015/05/12 16:02

投稿

jun68ykt
jun68ykt

スコア9058

answer CHANGED
@@ -13,6 +13,7 @@
13
13
  $("#img_view").html('<img src="img/'+imgs[$(this).attr("id")-1]+'">');
14
14
  });
15
15
  ```
16
+ とすれば、意図しているとおりに、クリックした画像が、#img_view に
16
- とすば、動くのではないかと思われます。
17
+ 表示さのではないかと思われます。
17
18
 
18
19
  ご参考になれば幸いです。

1

テキスト修正

2015/05/12 16:02

投稿

jun68ykt
jun68ykt

スコア9058

answer CHANGED
@@ -8,7 +8,6 @@
8
8
  });
9
9
  ```
10
10
  の中で、imgs[n-1] の n を $(this).attr("id") に変えて
11
-
12
11
  ```lang-javascript
13
12
  $("#"+n).on("click",function(){
14
13
  $("#img_view").html('<img src="img/'+imgs[$(this).attr("id")-1]+'">');