<div class="codetitle"> <span><a style="CURSOR: pointer" data="16195" class="copybut" id="copybut16195" onclick="doCopy('code16195')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code16195"> <br> <br><meta http-equiv="content-type" content="text/html; charset=UTF-8"> <br> <br><title></title> <br><script type="text/javascript"> <BR>function Reader(content, cID, stopID, continueID) { <BR>this.conLoad = document.getElementById(cID); <BR>this.stopBtn = document.getElementById(stopID); <BR>this.continueBtn = document.getElementById(continueID); <BR>this.content = content; <BR>this.index = 0; <BR>var t = this; <BR>this.stopBtn.onclick = ( <BR>function () { <BR>return function () { <BR>t.stopReader(t); <BR>}; <BR>})(t); <BR>this.continueBtn.onclick = ( <BR>function () { <BR>return function () { <BR>t.continueReader(t); <BR>}; <BR>})(t); <BR>} <BR>Reader.prototype = { <BR>startReader : function () { <BR>var t = this; <BR>t.toId = setInterval(function () { <BR>if (t.content[t.index]) { <BR>t.conLoad.innerHTML += t.content[t.index]; <BR>} <BR>t.index++; <BR>if (t.content.length == t.index) { <BR>clearInterval(t.toId); <BR>t.conLoad.innerHTML += "【未完待续】"; <BR>} <BR>}, 200); <BR>}, <BR>stopReader : function (t) { <BR>t.flag = true; <BR>clearInterval(t.toId); <BR>}, <BR>continueReader : function (t) { <BR>if (t.flag) <BR>t.startReader(); <BR>t.flag = false; <BR>} <BR>}; <BR>var content = "蒙古亲王僧格林沁慓悍勇猛,他率领的军队向来号称能征惯战,八旗兵、绿营他都看不上眼,更何况那些临时招募的练勇。可偏偏就是这些他眼中的乌合之众,这些年来在江南战果累累,最终攻下了江宁,夺得了对太平军作战的全胜。" + <BR>"相反地,他的蒙古铁骑在与捻军的角逐中常常打败仗,相形之下,昔日的声威锐减。这个一代天骄的后裔,对曾氏兄弟和湘军窝着一肚皮无名怒火。" + <BR> "湘军进江宁后,打劫财富,屠城纵火,又放走幼天王,朝野谤讟四起,物议沸腾,僧格林沁听了十分得意,赶紧打发富明阿以视察满城为由,去江宁实地了解。谁料曾国荃一吓一贿征服了富明阿,江宁将军回去后向僧格林沁作了假汇报。"; <BR>//页面加载完成之后执行。 <BR>window.onload = function () { <BR>new Reader(content, "content", "btnStop", "btnContinue").startReader(); <BR>}; <BR></script> <br> <br><div id="content"></div> <br><div id="operate"> <input type="button" id="btnStop" value="stop"><input type="button" id="btnContinue" value="continue"> </div> <br> <br><br> <br> </div>