下side是别的网友写的代码
<script> <…能。 <BR>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>*/ <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>