1 <script>
2 var start=0;
3 var n;
4 function init(){
5 start++;
6 }
7 function process(i){
8 n=setTimeout("init()",1000);
9 if(start>i){
10 clearTimeout(n);
11 start=0;
12 //这里写你需要执行的代码
13 }
14 }
15 </script>
2 var start=0;
3 var n;
4 function init(){
5 start++;
6 }
7 function process(i){
8 n=setTimeout("init()",1000);
9 if(start>i){
10 clearTimeout(n);
11 start=0;
12 //这里写你需要执行的代码
13 }
14 }
15 </script>