Home > Web Front-end > JS Tutorial > Multi-threaded select all checkbox_form effects

Multi-threaded select all checkbox_form effects

WBOY
Release: 2016-05-16 19:24:50
Original
1445 people have browsed it
复制代码 代码如下:



全部选择    
线程数:













/*
This following code are designed and writen by Windy_sk 
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");

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;ithread[i]=[setInterval("thread[" i "][1]}
thread[i]=[setInterval("thread[" i "][1]}

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)";
}
}


下面是运行效果
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template