无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<style>
BODY {FONT-SIZE: 9pt;}
table {FONT-SIZE: 9pt;}
</style>
<input type=checkbox id=checkall onclick=check_all()><label for=checkall>全部选择</label>
线程数:<input type=text id=the_thread value=10 size=2 maxlength=2 style="height:15px; font-size:12px;padding:0px">
<br>
<table border=0>
<tr><td style="width:100px;over-flow:hidden"><span id=show></span></td>
<td style="width:400px;">
<table id=bar style="width:90%;height:10px;border:1px black solid;display:none"><tr>
<td id=bar1 bgcolor=skyblue style="width:0%"></td>
<td id=bar2 style="width:100%"></td>
</tr></table>
</td></tr>
<tr><td colspan=2><span id=result></span></td></tr>
</table>
<script language="JavaScript">
/*
This following code are designed and writen by Windy_sk <seasonx@163.net>
You can use it freely, but u must held all the copyright items!
*/
var total = 505;
var thread_num;
var pre_thread;
var thread = new Array();
var completed = 0;
var start_time = null;
for(i=0;i<total;i++)document.write("<input type=checkbox id=cbox>");
function init_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 = "";
}
function check_all(){
checkall.disabled = true;
init_para();
for(var i=0;i<thread_num;i++){
thread[i]=[setInterval("thread["+i+"][1]<pre_thread?check_unit("+i+"*pre_thread + thread["+i+"][1]++):clearInterval(thread["+i+"][0])",1),0];
}
thread[i]=[setInterval("thread["+i+"][1]<total%thread_num?check_unit("+i+"*pre_thread + thread["+i+"][1]++):clearInterval(thread["+i+"][0])",1),0];
}
function check_unit(num){
if(completed==0)start_time=new Date;
cbox[num].checked=checkall.checked;
completed++;
var cur_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+"线程,总共耗时:"+((new Date)-start_time)+" ms)";
}
}
</script>
下面是运行效果
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
<style>
BODY {FONT-SIZE: 9pt;}
table {FONT-SIZE: 9pt;}
</style>
<input type=checkbox id=checkall onclick=check_all()><label for=checkall>全部选择</label>
线程数:<input type=text id=the_thread value=10 size=2 maxlength=2 style="height:15px; font-size:12px;padding:0px">
<br>
<table border=0>
<tr><td style="width:100px;over-flow:hidden"><span id=show></span></td>
<td style="width:400px;">
<table id=bar style="width:90%;height:10px;border:1px black solid;display:none"><tr>
<td id=bar1 bgcolor=skyblue style="width:0%"></td>
<td id=bar2 style="width:100%"></td>
</tr></table>
</td></tr>
<tr><td colspan=2><span id=result></span></td></tr>
</table>
<script language="JavaScript">
/*
This following code are designed and writen by Windy_sk <seasonx@163.net>
You can use it freely, but u must held all the copyright items!
*/
var total = 505;
var thread_num;
var pre_thread;
var thread = new Array();
var completed = 0;
var start_time = null;
for(i=0;i<total;i++)document.write("<input type=checkbox id=cbox>");
function init_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 = "";
}
function check_all(){
checkall.disabled = true;
init_para();
for(var i=0;i<thread_num;i++){
thread[i]=[setInterval("thread["+i+"][1]<pre_thread?check_unit("+i+"*pre_thread + thread["+i+"][1]++):clearInterval(thread["+i+"][0])",1),0];
}
thread[i]=[setInterval("thread["+i+"][1]<total%thread_num?check_unit("+i+"*pre_thread + thread["+i+"][1]++):clearInterval(thread["+i+"][0])",1),0];
}
function check_unit(num){
if(completed==0)start_time=new Date;
cbox[num].checked=checkall.checked;
completed++;
var cur_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+"线程,总共耗时:"+((new Date)-start_time)+" ms)";
}
}
</script>
下面是运行效果
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
标签:
多线程的全选复选框
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月16日
2024年11月16日
- 群星《2024好听新歌36》AI调整音效【WAV分轨】
- 梁朝伟.1986-朦胧夜雨裡(华星40经典)【华星】【WAV+CUE】
- 方芳.1996-得意洋洋【中唱】【WAV+CUE】
- 辛欣.2001-放120个心【上海音像】【WAV+CUE】
- 柏菲·万山红《花开原野1》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 柏菲·万山红《花开原野2》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 潘安邦《思念精选集全纪录》5CD[WAV+CUE]
- 杨千嬅《千嬅新唱金牌金曲》金牌娱乐 [WAV+CUE][985M]
- 杨钰莹《依然情深》首版[WAV+CUE][1G]
- 第五街的士高《印度激情版》3CD [WAV+CUE][2.4G]
- 三国志8重制版哪个武将智力高 三国志8重制版智力武将排行一览
- 三国志8重制版哪个武将好 三国志8重制版武将排行一览
- 三国志8重制版武将图像怎么保存 三国志8重制版武将图像设置方法
- 何方.1990-我不是那种人【林杰唱片】【WAV+CUE】
- 张惠妹.1999-妹力新世纪2CD【丰华】【WAV+CUE】