質問編集履歴

2

ソースコードの最後の}だけ抜けてたので追記

2020/07/31 00:12

投稿

pan2taicho
pan2taicho

スコア19

test CHANGED
File without changes
test CHANGED
@@ -186,6 +186,8 @@
186
186
 
187
187
  console.log("3");
188
188
 
189
+ }
190
+
189
191
  ```
190
192
 
191
193
  ### 試したこと

1

ソースコードを追加しました。

2020/07/31 00:12

投稿

pan2taicho
pan2taicho

スコア19

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,140 @@
54
54
 
55
55
 
56
56
 
57
+ ---追記 余計な情報も多いのですが、コードを丸々コピペしました。
58
+
59
+ ```Javascript
60
+
61
+ var serifutemp=document.getElementById('pan2serifu').textContent;
62
+
63
+ var text=serifutemp.split(",");
64
+
65
+
66
+
67
+ function reload(charactor){
68
+
69
+   console.log("1");
70
+
71
+ count++;
72
+
73
+ //要素ノードオブジェクト
74
+
75
+ if(charactor===1){
76
+
77
+ $('#novelsakujo').attr('id',"novel");
78
+
79
+ var novel=document.getElementById('novel');
80
+
81
+ $('#novel2').attr('id',"novelsakujo2");
82
+
83
+ $('#nareta').attr('id',"naretasakujo");
84
+
85
+ }else if(charactor===2){
86
+
87
+ $('#novelsakujo2').attr('id',"novel2");
88
+
89
+ var novel=document.getElementById('novel2');
90
+
91
+ $('#novel').attr('id',"novelsakujo");
92
+
93
+ $('#nareta').attr('id',"naretasakujo");
94
+
95
+ }else if(charactor===3){
96
+
97
+ $('#naretasakujo').attr('id',"nareta");
98
+
99
+ var novel=document.getElementById('nareta');
100
+
101
+ $('#novel').attr('id',"novelsakujo");
102
+
103
+ $('#novel2').attr('id',"novelsakujo2");
104
+
105
+ }
106
+
107
+
108
+
109
+ if(skipflag==1){
110
+
111
+ clearTimeout(myTimer);
112
+
113
+ return 0;
114
+
115
+ }
116
+
117
+ if(text[serifukaisu].substr(count-1,4)=="brbr"){
118
+
119
+ count=count+4;
120
+
121
+ novel.insertAdjacentHTML('beforeend','<br>');
122
+
123
+ }
124
+
125
+ if(text[serifukaisu].substr(count-1,2)=="#r"){
126
+
127
+ count=count+2;
128
+
129
+ var element = document.createElement('span');
130
+
131
+ element.setAttribute('class', 'red');
132
+
133
+ element.innerHTML = text[serifukaisu].substr(count-1,1);
134
+
135
+ novel.appendChild(element);
136
+
137
+ }else if(text[serifukaisu].substr(count-1,2)=="&b"){
138
+
139
+ count=count+2;
140
+
141
+ var element = document.createElement('span');
142
+
143
+ element.setAttribute('class', 'f34pt');
144
+
145
+ element.innerHTML = text[serifukaisu].substr(count-1,1);
146
+
147
+ novel.appendChild(element);
148
+
149
+ }else if(charactor===2||charactor===3){
150
+
151
+ var texttemp=text[serifukaisu].substr(0,text[serifukaisu].length-2);
152
+
153
+ var textNode=document.createTextNode(texttemp.substr(count-1,1));
154
+
155
+ novel.appendChild(textNode);
156
+
157
+ }else{
158
+
159
+ var textNode=document.createTextNode(text[serifukaisu].substr(count-1,1));
160
+
161
+ novel.appendChild(textNode);
162
+
163
+ }
164
+
165
+ console.log("2");
166
+
167
+ if(hayoflag===0){
168
+
169
+ myTimer=setTimeout("reload("+charactor+")",40);
170
+
171
+ }else{//メッセージ表示中にエンターを押した場合表示速度を早くする
172
+
173
+ myTimer=setTimeout("reload("+charactor+")",0);
174
+
175
+ }
176
+
177
+ if(count==text[serifukaisu].length){
178
+
179
+ clearTimeout(myTimer);
180
+
181
+ count=0;
182
+
183
+ serifukaisu++;
184
+
185
+ }
186
+
187
+ console.log("3");
188
+
189
+ ```
190
+
57
191
  ### 試したこと
58
192
 
59
193