抽签程序怎么制作,一个简单实用的抽签程序

抽签程序怎么制作,一个简单实用的抽签程序

一个简单实用的抽签程序,公司年会,学校,班级,等单位抽签使用也可以个人抽签使用,这个程序采用html 和javascript 编写,保存文件为抽签.html即可,可以在记事本中编辑程序代码。

<!doctype html>
<HTML>  
<HEAD>
<meta charset="utf-8">  
<style type="text/css">
body{
    font-size:100px;
    text-align:center;
}
input{
    width:350px;
    height:140px;
    font-size:80px;
}
</style>
 <TITLE>抽签 </TITLE>  
 <SCRIPT LANGUAGE="JavaScript">  
var names = [
"1","2","3","4","5","6","7","8","10","11","12","14","15","16","17","18","19","21","22","23","26","27","28","30","31","32","33","34","35","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","53","54","55","56","57","58","59","60","61","62"]; 

var name;
var index = -1;
var time;  
function begin(){  
document.getElementById("btnBegin").disabled = true;  
chouqian();  
}  
function chouqian(){
    if(names.length > 0){  
index = Math.floor(Math.random()*1000 % names.length);  
name = names[index];  
document.getElementById("result").innerHTML = name;  

time = window.setTimeout(chouqian,2);  
    }else{
        document.getElementById("result").innerHTML = "~结束~";  
    }
}  
function end(){  
window.clearTimeout(time);  
document.getElementById("btnBegin").disabled = false;  
names.splice(index, 1);
} 
 </SCRIPT>  
</HEAD>  

<BODY>  
<div>  
<h4>抽签小程序</h4>  
<h1 id="result" style="color:red;">^_^</h1>  
<INPUT TYPE="button" VALUE="开始" id="btnBegin" ONCLICK="begin();">   
<INPUT TYPE="button" VALUE="结束" id="btnEnd" ONCLICK="end();">  
<h5></h5>  
</div>  
</BODY>  
</HTML>

里面的数字使用人员可以任意修改,这里边就是抽签内容,可以把这些数字换成抽签的礼物,物品信息,姓名等,必须双引号,引起来,格式要和这个一致,把以上代码保存为一个.html或者.htm的文件在电脑上。然后电脑用浏览器打开即可使用。

[

“1”,”2″,”3″,”4″,”5″,”6″,”7″,”8″,”10″,”11″,”12″,”14″,”15″,”16″,”17″,”18″,”19″,”21″,”22″,”23″,”26″,”27″,”28″,”30″,”31″,”32″,”33″,”34″,”35″,”37″,”38″,”39″,”40″,”41″,”42″,”43″,”44″,”45″,”46″,”47″,”48″,”49″,”50″,”51″,”53″,”54″,”55″,”56″,”57″,”58″,”59″,”60″,”61″,”62″];

提醒:中括号里面的数字可以换成你想要抽签出来的内容,比如按照姓名抽签,可以换成姓名,按照物品抽签,可以换成物品名,特别指出来的是代码编写状态一定要在英文输入法状态,进行编写,特别是输入字母,符号的时候,一定要英文输入,在打汉字时才切换到汉字输入状态。。

效果如下

抽签程序怎么制作

抽签程序怎么制作

抽签程序怎么制作

是不是很简单,so easy!

创业项目、恋爱教程、投资理财、企业管理等VIP教程添加微信:1480998277  备注:学习

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2511786901@qq.com 举报,一经查实,本站将立刻删除。
如若转载,请注明出处:https://www.haipuo.com/3476.html

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

My title