抽签网页板代码
Posted httpssl
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了抽签网页板代码相关的知识,希望对你有一定的参考价值。
<!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 = [
"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22"
];
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>
<h3>抽签顺序</h3>
<h1 id="result" style="color:blue;">^_^</h1>
<INPUT TYPE="button" VALUE="开始" id="btnBegin" ONCLICK="begin();">
<INPUT TYPE="button" VALUE="结束" id="btnEnd" ONCLICK="end();">
</div>
</BODY>
</HTML>
以上是关于抽签网页板代码的主要内容,如果未能解决你的问题,请参考以下文章