Copy codeThe Code is 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 (){
Return function (){
T. continueReader (t );
};
}) (T );
}
Reader. prototype = {
StartReader: function (){
Var t = this;
T. toId = setInterval (function (){
If (t. content [t. index]) {
T. conLoad. innerHTML + = t. content [t. index];
}
T. index ++;
If (t. content. length = t. index ){
ClearInterval (t. toId );
T. conLoad. innerHTML + = "[To be continued ]";
}
},200 );
},
StopReader: function (t ){
T. flag = true;
ClearInterval (t. toId );
},
ContinueReader: function (t ){
If (t. flag)
T. startReader ();
T. flag = false;
}
};
Var content = "the prince of Mongolia is brave and brave, and the army he leads has always been known to be used to the war. He cannot see the eight flag soldiers or the green camp, not to mention those who are temporarily recruited and trained. However, these are all in his eyes. Over the past few years, the south of the Yangtze River suffered a great deal of results, and finally attacked Jiangning, winning the victory of the Taiping Army. "+
"On the contrary, his Mongolia iron ride often loses in the battle with the army, and in the dark, his old voice decreases sharply. The descendant of the generation of tianyao, with an unsung anger at Zeng's brother and Hunan army. "+
"After the Hunan army entered Jiangning, it robbed the fortune, destroyed the city, set fire, and let the young king go. The manye moles the four, and the discussion boiled. The Monk greenqin was very proud to hear it. He quickly sent fuming A to inspect mancheng, go to Jiangning to learn more. Who expected Zeng guoyi to fear a bribe to conquer fuming? After General Jiangning went back, he reported false information to the monk greenqin. ";
// Execute after the page is loaded.
Window. onload = function (){
New Reader (content, "content", "btnStop", "btnContinue"). startReader ();
};
</Script>
<Body>
<Div id = 'content'> </div>
<Div id = 'operate'> <input type = 'twent' id = 'btnstop' value = 'stop'/> <input type = 'twent' id = 'btncontinue 'value = 'continue '/> </div>
</Body>
</Html>