欢迎来到福编程网,本站提供各种互联网专业知识!

多线程的全选复选框

发布时间:2006-11-04 作者: 来源:转载
复制代码代码如下:BODY{FONT-SIZE:9pt;}table{FONT-SIZE:9pt;}全部选择线程数:/*ThisfollowingcodearedesignedandwritenbyWindy_skYoucanuseitfreely,butumustheldallthecopyrightitems!*/vartotal=505;varthread_num;varpre_thread;varthread=newArray(
复制代码 代码如下:

全部选择
线程数:













/*
ThisfollowingcodearedesignedandwritenbyWindy_sk
Youcanuseitfreely,butumustheldallthecopyrightitems!
*/
vartotal=505;
varthread_num;
varpre_thread;
varthread=newArray();
varcompleted=0;
varstart_time=null;

for(i=0;i");

functioninit_para(){
thread_num=parseInt(the_thread.value);
if(isNaN(thread_num))thread_num=10;
pre_thread=Math.floor(total/thread_num);
result.innerText="";
bar1.style.width="0%";
bar2.style.width="100%";
bar.style.display="";
}

functioncheck_all(){
checkall.disabled=true;
init_para();
for(vari=0;ithread[i]=[setInterval("thread["+i+"][1]}
thread[i]=[setInterval("thread["+i+"][1]}

functioncheck_unit(num){
if(completed==0)start_time=newDate;
cbox[num].checked=checkall.checked;
completed++;
varcur_rate=Math.round(completed*100/total);
show.innerText=completed+"/"+total+":"+cur_rate+"%";
bar1.style.width=cur_rate+"%";
bar2.style.width=(100-cur_rate)+"%";
if(completed==total){
completed=0
checkall.disabled=false;
result.innerText="("+total+"单元/"+thread_num+"线程,总共耗时:"+((newDate)-start_time)+"ms)";
}
}


下面是运行效果

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

相关推荐