<div class="codetitle"> <span><a style="CURSOR: pointer" data="51679" class="copybut" id="copybut51679" onclick="doCopy('code51679')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code51679"> <br><SCRIPT LANGUAGE="JavaScript"> <br><!-- <BR>function Sleep(obj,iMinSecond) <BR>{ <BR>if (window.eventList==null) <BR>window.eventList=new Array(); <BR>var ind=-1; <BR>for (var i=0;i<window.eventList.length;i ) <BR>{ <BR>if (window.eventList[i]==null) <BR>{ <BR>window.eventList[ i]=obj; <BR>ind=i; <BR>휴식; <BR>} <BR>} <BR>if (ind==-1) <BR>{ <BR>ind=window.eventList.length; <BR>window.eventList[ind]=obj; <BR>} <BR>setTimeout("GoOn(" ind ")",iMinSecond); <BR>} <BR>function GoOn(ind) <BR>{ <BR>var obj=window.eventList[ind]; <BR>window.eventList[ind]=null; <BR>if (obj.NextStep) obj.NextStep(); <BR>else obj(); <BR>} <br><br><BR>function Test() <BR>{ <BR>alert("sleep"); <BR>수면(이것,10000); <BR>this.NextStep=function() <BR>{ <BR>alert("계속"); <BR>} <BR>} <br><br>테스트(); <BR>//--> <br></SCRIPT> <br> </div> <br>下side是别的网友写的代码<br><div class="codetitle"> <span><a style="CURSOR: pointer" data="43393" class="copybut" id="copybut43393" onclick="doCopy('code43393')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code43393"> <br><script 언어="javascript"> javascript작성 为弱对象语言,一个函数也可以작품为一个对象使사용。 <br>比如: <br>function Test(){ <br>alert("hello"); <br>this.NextStep=function(){ <br>alert("NextStep"); <br>} <br>} <br>저는 var myTest=new Test();myTest.NextStep(); 暂停函数如下: <br>*/ <br>function Pause(obj,iMinSecond){ <br>if ( window.eventList==널) window.eventList=새 배열(); <br>var ind=-1; <br>for (var i=0;i<window.eventList.length;i ){ <BR>if (window.eventList[i]==null) { <BR>window.eventList[i]=obj; <BR>ind=i; <BR>휴식; <BR>} <BR>} <BR><BR>if (ind==-1){ <BR>ind=window.eventList.length; <BR>window.eventList[ind]=obj; <BR>} <br>setTimeout("GoOn(" ind ")",1000); <br>} <BR>/* <BR>该函数把要暂停的函数放到数组window.eventList는 setTimeout과 동일하게 사용됩니다. <BR><BR>继续函数다운로드: <BR>*/ <BR><BR>function GoOn(ind){ <br>var obj=window.eventList[ind]; <br>window.eventList[ind]=null; <BR>if (obj.NextStep) obj.NextStep(); <br>else obj(); <br>} <BR>/* <BR>该函数调用被暂停적函数的NextStep방법, 如果没有这个方法则则新调用该函数。 <BR><BR><BR>函数编写完毕,我们可以작품如下册是: <BR>*/ <BR>function Test(){ <br>alert("hello"); <br>Pause(this,1000);//调用暂停函数 <BR>this.NextStep=function(){ <BR>alert("NextStep"); <BR>} <BR>} <BR></script> <br><br> </div>