質問編集履歴

1

修正

2018/01/20 12:29

投稿

kodoumai
kodoumai

スコア7

test CHANGED
File without changes
test CHANGED
@@ -18,49 +18,49 @@
18
18
 
19
19
   $fileList
20
20
 
21
- //inputタグに画像が追加された場合の処理
21
+ //inputタグに画像が追加された場合の処理
22
22
 
23
- .on('change.inputFile', '.input_file', function(e){
23
+ .on('change.inputFile', '.input_file', function(e){
24
24
 
25
- var $input = $(this),
25
+ var $input = $(this),
26
26
 
27
- $li = $input.closest('.each_file'),
27
+ $li = $input.closest('.each_file'),
28
28
 
29
- $newLi = $li.clone();
29
+ $newLi = $li.clone();
30
30
 
31
- $fileList.append($newLi);
31
+ $fileList.append($newLi);
32
32
 
33
- //サムネイル画像を表示する処理
33
+ //サムネイル画像を表示する処理
34
34
 
35
- var file = e.target.files[0],
35
+ var file = e.target.files[0],
36
36
 
37
- //FileReaderオブジェクトの生成
37
+ //FileReaderオブジェクトの生成
38
38
 
39
- reader = new FileReader();
39
+ reader = new FileReader();
40
40
 
41
- reader.readAsDataURL(file);
41
+ reader.readAsDataURL(file);
42
42
 
43
- reader.onloadend = function(){
43
+ reader.onloadend = function(){
44
44
 
45
- var fileReader = this;
45
+ var fileReader = this;
46
46
 
47
- if(fileReader.result){
47
+ if(fileReader.result){
48
48
 
49
- var thumb = '<div class = "thumbnail"><a href="' + fileReader.result + '" class="swipebox"><img src="' + fileReader.result + '" width="100px" style="max-width: 100px;"></a><button class="delete_btn del-button ui-opaimg">削除</button></div>';
49
+ var thumb = '<div class = "thumbnail"><a href="' + fileReader.result + '" class="swipebox"><img src="' + fileReader.result + '" width="100px" style="max-width: 100px;"></a><button class="delete_btn del-button ui-opaimg">削除</button></div>';
50
50
 
51
- $li.append(thumb);
51
+ $li.append(thumb);
52
52
 
53
- }
53
+ }
54
54
 
55
- return this;
55
+ return this;
56
56
 
57
- };
57
+ };
58
58
 
59
- $input.hide();
59
+ $input.hide();
60
60
 
61
- });
61
+ });
62
62
 
63
- });
63
+ });
64
64
 
65
65
  ```
66
66