ホームページ ウェブフロントエンド jsチュートリアル javascript_javascriptスキルに基づいた文章フリップWeb版ミニゲームの実装

javascript_javascriptスキルに基づいた文章フリップWeb版ミニゲームの実装

May 16, 2016 pm 03:08 PM

この記事の例では、参考までに Web バージョンの文フリップゲームの js 実装を共有します。具体的な内容は次のとおりです。

レンダリング:

実装のアイデア:

タイピングと記憶力をテストするパズル ゲーム。
1. 最初にテキストが表示されます
2.しばらくすると裏面が表示されます
3. 入力ボックスに入力したテキストとそれに対応するテキストが前面に表示されます

特定のコード:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>句子翻牌</title>

<link href="css/reset.css" rel="stylesheet" />

<link href="css/fanpai.css" rel="stylesheet" />

<script type="text/javascript" src="js/jquery-1.10.2.js"></script>

<script type="text/javascript">

$(function(){

 //ht5 dom

 var otestAudio=document.getElementById("test-audio");

 //data

 var data_all=[];

 data_all[0]=[

 {id:'0',text:'我,爱你,吗,?',is:true,count:3,'url':'audio/1.mp3'},

 {id:'1',text:'亲爱的,你,好吗,?',is:true,count:3,'url':'audio/2.mp3'},

 {id:'2',text:'不知道,啊,!',is:true,count:2,'url':'audio/3.mp3'},

 {id:'3',text:'谢谢,你,说的,。',is:true,count:3,'url':'audio/4.mp3'},

 {id:'4',text:'也许,对吧,!',is:true,count:2,'url':'audio/5.mp3'},

 {id:'5',text:'听,不懂,啊,!',is:true,count:3,'url':'audio/1.mp3'},

 {id:'6',text:'天天,向上,,,好好,学习,。',is:true,count:4,'url':'audio/2.mp3'},

 {id:'7',text:'你,说的,不,对,!',is:true,count:4,'url':'audio/3.mp3'},

 {id:'8',text:'不要,问,为什么,!',is:true,count:3,'url':'audio/4.mp3'},

 {id:'9',text:'很,难,理解,你的话,。',is:true,count:4,'url':'audio/5.mp3'},

 {id:'10',text:'你,不爱你,吗,?',is:true,count:3,'url':'audio/1.mp3'},

 {id:'11',text:'妈妈,你,好吗,?',is:true,count:3,'url':'audio/2.mp3'},

 {id:'12',text:'想,知道,啊,!',is:true,count:3,'url':'audio/3.mp3'},

 {id:'13',text:'你,说的,。',is:true,count:2,'url':'audio/4.mp3'},

 {id:'14',text:'真的,也许,对吧,!',is:true,count:3,'url':'audio/5.mp3'},

 {id:'15',text:'完全,听,不懂,啊,!',is:true,count:4,'url':'audio/1.mp3'},

 {id:'16',text:'要,努力,读书。',is:true,count:3,'url':'audio/2.mp3'},

 {id:'17',text:'他,说的,不,对,!',is:true,count:4,'url':'audio/3.mp3'},

 {id:'18',text:'请,问,快了吗,!',is:true,count:4,'url':'audio/4.mp3'},

 {id:'19',text:'哈哈,难,理解,你的话,。',is:true,count:4,'url':'audio/5.mp3'}

 ];

 data_all[1]=[

 {id:'0',text:'你说出,你的,问题,去,改进,。',is:true,count:5,'url':'audio/1.mp3'},

 {id:'1',text:'我,怎么,知道,你,好不好,?',is:true,count:5,'url':'audio/2.mp3'},

 {id:'2',text:'不要,问,为什么,好吗,?',is:true,count:4,'url':'audio/3.mp3'},

 {id:'3',text:'就,你,说的,是,对的,。',is:true,count:5,'url':'audio/4.mp3'},

 {id:'4',text:'大家,明天,一起,出去,郊游,。',is:true,count:5,'url':'audio/5.mp3'},

 {id:'5',text:'你,一定,要帅,,,一定,要低调,。',is:true,count:5,'url':'audio/1.mp3'},

 {id:'6',text:'你,去了,你二大爷,家,了吗,?',is:true,count:5,'url':'audio/2.mp3'},

 {id:'7',text:'天南,海北,,,众人,皆是,。',is:true,count:4,'url':'audio/3.mp3'},

 {id:'8',text:'天与海,的,距离,就是,不爱你,。',is:true,count:5,'url':'audio/4.mp3'},

 {id:'9',text:'不知道,无罪,,,坚强,些,。',is:true,count:4,'url':'audio/5.mp3'},

 {id:'10',text:'大中华,儿女,,,华夏,子孙,。',is:true,count:4,'url':'audio/1.mp3'},

 {id:'11',text:'儿时,的,时光,是,美好的,。',is:true,count:5,'url':'audio/2.mp3'},

 {id:'12',text:'哪里,那么,多,秘密,。',is:true,count:4,'url':'audio/3.mp3'},

 {id:'13',text:'有,你,就是,晴天,,,对吧,!',is:true,count:5,'url':'audio/4.mp3'},

 {id:'14',text:'说的,和,真的,似的,,,太假了,!',is:true,count:5,'url':'audio/5.mp3'},

 {id:'15',text:'呵呵,,,净,瞎扯淡,!',is:true,count:3,'url':'audio/1.mp3'},

 {id:'16',text:'行了,,,就,你,知道,?',is:true,count:4,'url':'audio/2.mp3'},

 {id:'17',text:'好好,学习,,,才能,越来越好,。',is:true,count:4,'url':'audio/3.mp3'},

 {id:'18',text:'真的,无所依,,,孤独的,我,。',is:true,count:4,'url':'audio/4.mp3'},

 {id:'19',text:'你知道,的话,就,说,出来嘛,!',is:true,count:5,'url':'audio/5.mp3'}

 ];

 data_all[2]=[

 {id:'0',text:'我,爱你,吗,?',is:true,count:3,'url':'audio/1.mp3'},

 {id:'1',text:'亲爱的,你,好吗,?',is:true,count:3,'url':'audio/2.mp3'},

 {id:'2',text:'不知道,啊,!',is:true,count:2,'url':'audio/3.mp3'},

 {id:'3',text:'谢谢,你,说的,。',is:true,count:3,'url':'audio/4.mp3'},

 {id:'4',text:'也许,对吧,!',is:true,count:2,'url':'audio/5.mp3'},

 {id:'5',text:'听,不懂,啊,!',is:true,count:3,'url':'audio/1.mp3'},

 {id:'6',text:'天天,向上,,,好好,学习,。',is:true,count:4,'url':'audio/2.mp3'},

 {id:'7',text:'你,说的,不,对,!',is:true,count:4,'url':'audio/3.mp3'},

 {id:'8',text:'不要,问,为什么,!',is:true,count:3,'url':'audio/4.mp3'},

 {id:'9',text:'很,难,理解,你的话,。',is:true,count:4,'url':'audio/5.mp3'},

 {id:'10',text:'你,不爱你,吗,?',is:true,count:3,'url':'audio/1.mp3'},

 {id:'11',text:'妈妈,你,好吗,?',is:true,count:3,'url':'audio/2.mp3'},

 {id:'12',text:'想,知道,啊,!',is:true,count:3,'url':'audio/3.mp3'},

 {id:'13',text:'你,说的,。',is:true,count:2,'url':'audio/4.mp3'},

 {id:'14',text:'真的,也许,对吧,!',is:true,count:3,'url':'audio/5.mp3'},

 {id:'15',text:'完全,听,不懂,啊,!',is:true,count:4,'url':'audio/1.mp3'},

 {id:'16',text:'要,努力,读书。',is:true,count:3,'url':'audio/2.mp3'},

 {id:'17',text:'他,说的,不,对,!',is:true,count:4,'url':'audio/3.mp3'},

 {id:'18',text:'请,问,快了吗,!',is:true,count:4,'url':'audio/4.mp3'},

 {id:'19',text:'哈哈,难,理解,你的话,。',is:true,count:4,'url':'audio/5.mp3'}

 ];

 data_all[3]=[

 {id:'0',text:'你说出,你的,问题,去,改进,。',is:true,count:5,'url':'audio/1.mp3'},

 {id:'1',text:'我,怎么,知道,你,好不好,?',is:true,count:5,'url':'audio/2.mp3'},

 {id:'2',text:'不要,问,为什么,好吗,?',is:true,count:4,'url':'audio/3.mp3'},

 {id:'3',text:'就,你,说的,是,对的,。',is:true,count:5,'url':'audio/4.mp3'},

 {id:'4',text:'大家,明天,一起,出去,郊游,。',is:true,count:5,'url':'audio/5.mp3'},

 {id:'5',text:'你,一定,要帅,,,一定,要低调,。',is:true,count:5,'url':'audio/1.mp3'},

 {id:'6',text:'你,去了,你二大爷,家,了吗,?',is:true,count:5,'url':'audio/2.mp3'},

 {id:'7',text:'天南,海北,,,众人,皆是,。',is:true,count:4,'url':'audio/3.mp3'},

 {id:'8',text:'天与海,的,距离,就是,不爱你,。',is:true,count:5,'url':'audio/4.mp3'},

 {id:'9',text:'不知道,无罪,,,坚强,些,。',is:true,count:4,'url':'audio/5.mp3'},

 {id:'10',text:'大中华,儿女,,,华夏,子孙,。',is:true,count:4,'url':'audio/1.mp3'},

 {id:'11',text:'儿时,的,时光,是,美好的,。',is:true,count:5,'url':'audio/2.mp3'},

 {id:'12',text:'哪里,那么,多,秘密,。',is:true,count:4,'url':'audio/3.mp3'},

 {id:'13',text:'有,你,就是,晴天,,,对吧,!',is:true,count:5,'url':'audio/4.mp3'},

 {id:'14',text:'说的,和,真的,似的,,,太假了,!',is:true,count:5,'url':'audio/5.mp3'},

 {id:'15',text:'呵呵,,,净,瞎扯淡,!',is:true,count:3,'url':'audio/1.mp3'},

 {id:'16',text:'行了,,,就,你,知道,?',is:true,count:4,'url':'audio/2.mp3'},

 {id:'17',text:'好好,学习,,,才能,越来越好,。',is:true,count:4,'url':'audio/3.mp3'},

 {id:'18',text:'真的,无所依,,,孤独的,我,。',is:true,count:4,'url':'audio/4.mp3'},

 {id:'19',text:'你知道,的话,就,说,出来嘛,!',is:true,count:5,'url':'audio/5.mp3'}

 ];

  

 var guan_arr=[

 {n:'第一关',c:'正常语序'},

 {n:'第二关',c:'熟练熟悉'},

 {n:'第三关',c:'注意:词语打乱了'},

 {n:'第四关',c:'全神贯注'},

 {n:'第五关',c:'困难语序'}

 ];

 //base

 var current_guan=1;//当前所在关卡

 var current_index=0;//答对记录数

 var dong=null;//全局动画

 var alltime=300;//答题时间

 var iskey=true;//是否按键可用

 var count=0;//词语记录数

 var subindex=null;//子记录键

 var starttime=0;//开始时作答时间

 //event

 $(".game-fp-start").click(function(){

 $(".game-fp-name").hide();

 $(".game-fp-sm").hide();

 $(".game-fp-start").hide();

 init();

 });

 $(".game-fp-tools-see").children("dt").click(function(){

 funopen();

 setTimeout(function(){

 funclose();

 },2000);

 });

 $("#game-fp-input").children("input").keyup(function(){

 if(iskey){

 var stext=$(this).val();

 matchval(stext);

 next($("#game-fp-words").children("div").length);

 }else{}; 

 });

 $(".game-fp-tools-pause").click(function(){

 if($("#game-fp-input").children("input").prop('disabled')==false){

 clearInterval(dong);

 $("#game-fp-input").children("input").attr('disabled','disabled');

 $("#game-fp-pause").show();

 }else{}

 });

 $("#game-fp-sta").click(function(){

 $("#game-fp-input").children("input").removeAttr('disabled');

 $("#game-fp-pause").hide();

 $("#game-fp-input").children("input").focus();

 inctime();

 });

 $("#game-fp-reset-btn").click(function(){

 current_guan=1;

 current_index=0;

 alltime=300;

 iskey=true;

 subindex=null;

 count=0;

 for(var i=0;i<data_all.length;i++){

 for(var j=0;j<data_all[i].length;j++){

 data_all[i][j]['is']=true;

 };

 };

 $("#game-fp-reset").hide();

 init();

 });

 $(".game-fp-tools-skip").children("dt").click(function(){

 if($("#game-fp-input").children("input").prop('disabled')==false){

 if($(this).children("span").html()<=0){

  

 }else{

 $(this).children("span").html($(this).children("span").html()-1);

 $("#game-fp-words").children().remove();

 fundata();

 };

 }else{}

 });

 $(window).keyup(function(event){

 switch (event.which)

 {

 case 35://end

 $(".game-fp-tools-pause").trigger("click");

 break;

 case 36://hpme

  

 break;

 case 33://pageup

 $(".game-fp-tools-see").children("dt").trigger("click");

 break;

 case 34://pagedown

 $(".game-fp-tools-skip").children("dt").trigger("click");

 break;

 }

 });

 //handel

 function matchval(stext){

 var real=stext;

 var delay=0;

 $("#game-fp-words").children("div").each(function(index, element) {

 var ishas=stext.search($(this).children("span").text());

 var that=$(this);

 if(ishas>-1 && $(this).attr("is")=="0"){

 delay=parseInt(delay)+parseInt(80);

 $(this).attr("is","1");

 addfen(10);

 setTimeout(function(){

  that.removeClass("close").addClass("open");

  that.children("em").addClass("feiqi");

 },delay);

 real=real.replace($(this).children("span").text(),"");

 }else{

 };   

  });

 $("#game-fp-input").children("input").val(real);

 };

 function addfen(num){

 $("#game-fp-fen").find("input").val(parseInt($("#game-fp-fen").find("input").val())+parseInt(num));

 };

 function next(zlen){

 if($("#game-fp-words").children("div[is='1']").length==zlen && $("#game-fp-input").children("input").val().length==0){

 iskey=false;

 success();

 }else{};

  

 };

 function success(){

 showok();

 var alltime=null;

 if(otestAudio.duration){

 alltime=otestAudio.duration;

 skipsuccess(alltime);

 }else{

 otestAudio.onloadedmetadata=function(){

 alltime=otestAudio.duration;

 skipsuccess(alltime);

 };

 };

  

 };

 function showok(){

 $("#game-fp-words").children().remove();

 var rindex=current_guan-1;

 var zz=chatime();

 $("#game-fp-result").show();

 $("#game-fp-result").append('<strong class="zonghefen zonghefeiqi">20</strong>');

 $("#game-fp-result").append('<strong class="mintimefen mintimefeiqi">'+zz+'</strong>')

 addfen($("#game-fp-result").children(".zonghefen").html());

 addfen($("#game-fp-result").children(".mintimefen").html());

 var showval=data_all[rindex][subindex].text.split(",").join("");

 count=parseInt(count)+parseInt(data_all[rindex][subindex].count);

 $("#game-fp-result").children("p").html(showval);

 otestAudio.src=data_all[rindex][subindex].url;

 };

 function chatime(){

 var chaval=(new Date().getTime()-starttime)/1000;

 if(chaval<=5){

 return 30;

 }else if(chaval>5 && chaval<=10){

 return 20;

 }else if(chaval>10){

 return 10;

 }else{

 return 0;

 };

 };

 function skipsuccess(alltime){

 otestAudio.play();

 current_index=parseInt(current_index)+parseInt(1);

 if(current_index%10==0){

 current_guan=parseInt(current_guan)+parseInt(1);

 setTimeout(function(){

 $("#game-fp-result").children(".zonghefen").remove();

 $("#game-fp-result").children(".mintimefen").remove();

 $("#game-fp-result").hide();

 funguan();

 },parseInt(alltime*1000)); 

 setTimeout(function(){

 fundata();

 },parseInt(alltime*1000)+parseInt(1000));

 }else{

 setTimeout(function(){

 $("#game-fp-result").children(".zonghefen").remove();

 $("#game-fp-result").children(".mintimefen").remove();

 $("#game-fp-result").hide();

 fundata();

 },parseInt(alltime*1000));

 };

 $("#game-fp-input").children("input").val("");

 };

 //function

 function init(){

 $("#game-fp-box").show();

 $("#game-fp-input").children("input").val("");

 $("#game-fp-fen").find("input").val("0");

 $("#game-fp-input").children("input").attr('disabled','disabled');

 $("#game-fp-time").children("span").html(alltime);

 funguan();

 setTimeout(function(){

 fundata();

 },1000);

 inctime();

 };

 function funguan(){

 $("#game-fp-guanka").children("strong").html(guan_arr[current_guan-1].n);

 $("#game-fp-guanka").children("span").html(guan_arr[current_guan-1].c);

 $("#game-fp-guanka").show();

 setTimeout(function(){

 $("#game-fp-guanka").hide();

 },1000)

 };

 function fundata(){

 $("#game-fp-input").children("input").attr('disabled','disabled');

 setTimeout(function(){

 appenddata();

 iskey=true;

 },0);

 setTimeout(function(){

 funclose();

 $("#game-fp-input").children("input").focus();

 },2000);

 };

 function appenddata(){

 if(current_guan<=2){

 var arrtext=returnraditem().text.split(",");

 //console.log(current_guan+"-----"+returnraditem().id);

 for(var i=0;i<arrtext.length;i++){

 var tmp=$('<div class="fanpai" is="0"><span>'+ arrtext[i] +'</span><em>10</em></div>');

 $("#game-fp-words").append(tmp);

 };

 }else if(current_guan>2 && current_guan<=4){

 var arrtext=returnraditem().text.split(",");

 //乱序处理

 var lasttext=[];

 var eearr=luanxu(arrtext.length);

 for(var j=0;j<eearr.length;j++){

 lasttext.push(arrtext[eearr[j]]);

 };

 for(var i=0;i<lasttext.length;i++){

 var tmp=$('<div class="fanpai" is="0"><span>'+ lasttext[i] +'</span><em>10</em></div>');

 $("#game-fp-words").append(tmp);

 };

 };

 };

 function luanxu(maxlen){

 var rarr=[];

 for(var i=0;i<maxlen;i++){

 rarr.push(i);

 };

 var eearr=[];

 for(var j=0;j<maxlen;j++){

 var ing=Math.floor(Math.random()*rarr.length);

 eearr.push(rarr[ing]);

 rarr.splice(ing,1);

 };

 return eearr;

 };

 function returnraditem(){

 var rindex=current_guan-1;

 var temparr=[];

 for(var i=0;i<data_all[rindex].length;i++){

 if(data_all[rindex][i]['is']==true){

 temparr.push(data_all[rindex][i]);

 }else{};

 };

 var realrad=Math.floor(Math.random()*temparr.length);

 for(var i=0;i<data_all[rindex].length;i++){

 if(data_all[rindex][i]['id']==temparr[realrad]['id']){

 data_all[rindex][i]['is']=false;

 subindex=i;

 }else{};

 };

 return temparr[realrad];

 };

 function funclose(){

 $("#game-fp-input").children("input").removeAttr('disabled');

 $("#game-fp-input").children("input").focus();

 starttime=new Date().getTime();

 $("#game-fp-words").children("div").each(function(index, element) {

   if($(this).attr("is")=="0"){

 $(this).removeClass("open").addClass("close");

 }else{};

  });

 };

 function funopen(){

 $("#game-fp-input").children("input").attr('disabled','disabled');

 $("#game-fp-words").children("div").each(function(index, element) {

   if($(this).attr("is")=="0"){

 $(this).removeClass("close").addClass("open");

 }else{};

  });

  

 };

 function inctime(){

 dong=setInterval(function(){

 alltime-=1;

 if(alltime<0){

 clearInterval(dong);

 $("#game-fp-words").children().remove();

 $("#game-fp-box").hide();

 $("#game-fp-input").children("input").attr('disabled','disabled');

 $(".game-fp-reset-con-a").html($("#game-fp-fen").find("input").val());

 $(".game-fp-reset-con-b").html(current_index);

 $(".game-fp-reset-con-c").html(count);

 $("#game-fp-reset").show();

 }else{

 $("#game-fp-time").children("span").html(alltime);

 };

 },1000);

 };

 //end

});

</script>

</head>

<body>

 <div id="game-fp">

  <div class="game-fp-name">句子翻牌</div>

  <div class="game-fp-sm">

   <p>1.将牌面上的词语输入到方块中。</p>

   <p>2.按照正确语序输入句子能获得额外奖励。</p>

   <p>3.每组词语显示2-4秒。</p>

   <p class="game-fp-sm-x">查看词语:点击“查看词语”,或按“PageUp”键</p>

   <p>4.一共有10次机会。</p>

   <p class="game-fp-sm-x">跳过词语:点击“跳过10”,或按“PageDown”键</p>

   <p>5.别忘了输入标点符号!</p>

  </div>

  <div class="game-fp-start">开始游戏</div>

  <div id="game-fp-box">

   <div id="game-fp-fen">

    得分<span><input type="text" value="0" readonly="readonly" /></span>

   </div>

   <div id="game-fp-input">

    <input type="text" />

   </div>

   <div id="game-fp-time">

    剩余时间 <span>300</span>

   </div>

   <div id="game-fp-tools">

    <dl class="game-fp-tools-pause">

     <dt>暂停</dt>

     <dd>End</dd>

    </dl>

    <dl class="game-fp-tools-see">

     <dt>再看一次</dt>

     <dd>PageUp</dd>

    </dl>

    <dl class="game-fp-tools-skip">

     <dt>跳过<span>10</span></dt>

     <dd>PageDown</dd>

    </dl>

    <dl class="game-fp-tools-ts">

     <dt>游戏说明</dt>

     <dd>Home</dd>

    </dl>

   </div>

   <div id="game-fp-words">

   </div>

   <div id="game-fp-guanka">

    <strong>第一关</strong>

    <span>正常词序</span>

   </div>

   <div id="game-fp-pause">

    <span id="game-fp-sta">继续</span>

   </div>

  

   <div id="game-fp-result">

    <div><span>正确语序</span><em><audio src="" id="test-audio"></audio></em></div>

    <p></p>

    <!--<strong class="zonghefen">20</strong>

    <strong class="mintimefen">0</strong>-->

   </div>

  

  </div>

  <div id="game-fp-reset">

   <div class="game-fp-reset-con">   

    <p>游戏结束</p>

    <p>你的得分:<span class="game-fp-reset-con-a">0</span></p>

    <p>完成句子:<span class="game-fp-reset-con-b">0</span></p>

    <p>完成词语:<span class="game-fp-reset-con-c">0</span></p>

   </div>

   <span id="game-fp-reset-btn">再玩一次</span>

  </div>

 </div>

  

</body>

</html>

ログイン後にコピー

コードのダウンロード: http://xiazai.jb51.net/201603/yuanma/juzifanpai(jb51.net).rar

ゲームだけでは物足りないと感じたら、次のトピックもチェックしてください: JavaScript クラシック ミニ ゲーム

以上がこの記事の全内容です。JavaScript プログラミングを学習する皆さんのお役に立てれば幸いです。

このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

フロントエンドのサーマルペーパーレシートのために文字化けしたコード印刷に遭遇した場合はどうすればよいですか? フロントエンドのサーマルペーパーレシートのために文字化けしたコード印刷に遭遇した場合はどうすればよいですか? Apr 04, 2025 pm 02:42 PM

フロントエンドのサーマルペーパーチケット印刷のためのよくある質問とソリューションフロントエンド開発におけるチケット印刷は、一般的な要件です。しかし、多くの開発者が実装しています...

javascriptの分解:それが何をするのか、なぜそれが重要なのか javascriptの分解:それが何をするのか、なぜそれが重要なのか Apr 09, 2025 am 12:07 AM

JavaScriptは現代のWeb開発の基礎であり、その主な機能には、イベント駆動型のプログラミング、動的コンテンツ生成、非同期プログラミングが含まれます。 1)イベント駆動型プログラミングにより、Webページはユーザー操作に応じて動的に変更できます。 2)動的コンテンツ生成により、条件に応じてページコンテンツを調整できます。 3)非同期プログラミングにより、ユーザーインターフェイスがブロックされないようにします。 JavaScriptは、Webインタラクション、シングルページアプリケーション、サーバー側の開発で広く使用されており、ユーザーエクスペリエンスとクロスプラットフォーム開発の柔軟性を大幅に改善しています。

誰がより多くのPythonまたはJavaScriptを支払われますか? 誰がより多くのPythonまたはJavaScriptを支払われますか? Apr 04, 2025 am 12:09 AM

スキルや業界のニーズに応じて、PythonおよびJavaScript開発者には絶対的な給与はありません。 1. Pythonは、データサイエンスと機械学習でさらに支払われる場合があります。 2。JavaScriptは、フロントエンドとフルスタックの開発に大きな需要があり、その給与もかなりです。 3。影響要因には、経験、地理的位置、会社の規模、特定のスキルが含まれます。

JavaScriptを使用して、同じIDを持つArray要素を1つのオブジェクトにマージする方法は? JavaScriptを使用して、同じIDを持つArray要素を1つのオブジェクトにマージする方法は? Apr 04, 2025 pm 05:09 PM

同じIDを持つ配列要素をJavaScriptの1つのオブジェクトにマージする方法は?データを処理するとき、私たちはしばしば同じIDを持つ必要性に遭遇します...

JavaScriptは学ぶのが難しいですか? JavaScriptは学ぶのが難しいですか? Apr 03, 2025 am 12:20 AM

JavaScriptを学ぶことは難しくありませんが、挑戦的です。 1)変数、データ型、関数などの基本概念を理解します。2)非同期プログラミングをマスターし、イベントループを通じて実装します。 3)DOM操作を使用し、非同期リクエストを処理することを約束します。 4)一般的な間違いを避け、デバッグテクニックを使用します。 5)パフォーマンスを最適化し、ベストプラクティスに従ってください。

Shiseidoの公式Webサイトのように、視差スクロールと要素のアニメーション効果を実現する方法は?
または:
Shiseidoの公式Webサイトのようにスクロールするページを伴うアニメーション効果をどのように実現できますか? Shiseidoの公式Webサイトのように、視差スクロールと要素のアニメーション効果を実現する方法は? または: Shiseidoの公式Webサイトのようにスクロールするページを伴うアニメーション効果をどのように実現できますか? Apr 04, 2025 pm 05:36 PM

この記事の視差スクロールと要素のアニメーション効果の実現に関する議論では、Shiseidoの公式ウェブサイト(https://www.shisido.co.co.jp/sb/wonderland/)と同様の達成方法について説明します。

Console.log出力の違い結果:なぜ2つの呼び出しが異なるのですか? Console.log出力の違い結果:なぜ2つの呼び出しが異なるのですか? Apr 04, 2025 pm 05:12 PM

Console.log出力の違いの根本原因に関する詳細な議論。この記事では、Console.log関数の出力結果の違いをコードの一部で分析し、その背後にある理由を説明します。 �...

フロントエンド開発でVSCodeと同様に、パネルドラッグアンドドロップ調整機能を実装する方法は? フロントエンド開発でVSCodeと同様に、パネルドラッグアンドドロップ調整機能を実装する方法は? Apr 04, 2025 pm 02:06 PM

フロントエンドのVSCodeと同様に、パネルドラッグアンドドロップ調整機能の実装を調べます。フロントエンド開発では、VSCODEと同様のVSCODEを実装する方法...

See all articles