This article mainly introduces the use of JavaScript to write a simulated reading of the novel program, the need for friends can refer to the following
Code as follows: <html> <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/> <head> <title></title> <script type=" Text/javascript " > function Reader (content, CID, Stopid, Continueid) { this.conload = document.getElementById (CID); THIS.STOPBTN = document.getElementById (stopid); this.continuebtn = document.getElementById (ContinueID); This.content = content; This.index = 0; var t = this; This.stopBtn.onclick = ( function () { return function () { t.stopreader (t); }; }) (t); This.continueBtn.onclick = ( function () {& nbsp return function () { t.continuereader (t); }; }) (t); } = Reader.prototype { R:function () { var t = this; t.toid = setinterval (function () { if (t.content[t.index)) { T.con load.innerhtml + t.content[t.index]; } t.index++; if (T.content.length = = T.index) { clearinterval (t.toid); t.conload.innerhtml = "To Be Continued" "; } },"; }, : Function (t) { T.flag = true; clearinterval (t.toid); }, continuereader:function (t) { if ( T.flag) T.startreader (); T.flag = false; } }; var content = "Mongolian Prince Monk Green Qin 慓 Shong Fierce, he led the army has always been known as Northen, Baqi, Greens He is beginning, not to mention those temporary recruitment of practice Yong. But this is the mob in his eyes, these years in the south of the fruitful, finally attack the Jiangning, won the battle against Taiping. "+ " On the contrary, his Mongolian cavalry in the rivalry with the Nien often defeated the war, by contrast, the former prestige has plummeted. This generation of heroes of the descendants of the former brothers and the Xiang Army nest a belly unknown anger. "+ " Xiang Army into the Jiangning, Rob Wealth, massacre arson, and release the young king, the opposition to slander Blasphemies four, South, Monk Green Qin heard very proud, hurriedly sent Fu Ming to inspect the town, to Jiangning field understanding. But Zeng a scare a bribe conquered Rich Ming Ah, jiangning general back to Monk Green Qin made a false report. Execution after the; //page load completes. window.onload = function () { new Reader (content, "content", "Btnstop", "Btncontinue"). Startreader (); }; </script> <body> <div id= ' content ' ></div> <div id= ' operate ' ><input type= ' button ' id= ' btnstop ' value= ' Stop '/><input type= ' button 'Id= ' btncontinue ' value= ' Continue '/></div> </body> </html>