html 抽奖代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>抽奖</title>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<script language="javascript">
<!--
// global variables
var timer;
var flag = new Array(100);
var existingnum = new Array(100);
var clickTimes = 0;
var randnum;
var cellnum = 1;
var mobile = new Array();
// set data here!!
mobile[0] = 13020000100;
mobile[1] = 13020000101;
mobile[2] = 13020000102;
mobile[3] = 13020000103;
mobile[4] = 13020000104;
mobile[5] = 13020000105;
mobile[6] = 13020000106;
mobile[7] = 13020000107;
mobile[8] = 13020000108;
mobile[9] = 13020000109;
mobile[10] = 13020000110;
mobile[11] = 13020000111;
mobile[12] = 13020000112;
mobile[13] = 13020000113;
mobile[14] = 13020000114;
mobile[15] = 13020000115;
mobile[16] = 13020000116;
mobile[17] = 13020000117;
mobile[18] = 13020000118;
mobile[19] = 13020000119;
mobile[20] = 13020000120;
mobile[21] = 13020000121;
mobile[22] = 13020000122;
mobile[23] = 13020000123;
mobile[24] = 13020000124;
mobile[25] = 13020000125;
mobile[26] = 13020000126;
mobile[27] = 13020000127;
mobile[28] = 13020000128;
mobile[29] = 13020000129;
mobile[30] = 13020000130;
mobile[31] = 13020000131;
mobile[32] = 13020000132;
mobile[33] = 13020000133;
mobile[34] = 13020000134;
mobile[35] = 13020000135;
mobile[36] = 13020000136;
mobile[37] = 13020000137;
mobile[38] = 13020000138;
mobile[39] = 13020000139;
mobile[40] = 13020000140;
mobile[41] = 13020000141;
mobile[42] = 13020000142;
mobile[43] = 13020000143;
mobile[44] = 13020000144;
mobile[45] = 13020000145;
mobile[46] = 13020020146;
var num = mobile.length - 1; function getRandNum() {
num = parseInt(num);
var y = GetRnd(0, num);
document.getElementById("result").value = mobile[y];
} function start() {
clearInterval(timer);
timer = setInterval('change()', 50);
} function ok() {
clearInterval(timer);
} function GetRnd(m, n) {
randnum = parseInt(Math.random() * (n - m + 1));
return randnum;
} function setTimer() {
time = setInterval("getRandNum()", 10);
document.getElementById("start").disabled = true;
document.getElementById("end").disabled = false;
} function clearTimer() {
noDupNum();
clearInterval(time);
document.getElementById("start").disabled = false;
document.getElementById("end").disabled = true;
setValues();
} function noDupNum() {
// to remove the selected mobile phone number
mobile.removeEleAt(randnum);
// to reorganize the mobile number array!!
var o = 0;
for (p = 0; p < mobile.length; p++) {
if (typeof mobile[p] != "undefined") {
mobile[o] = mobile[p];
o++;
}
}
num = mobile.length - 1;
}
// method to remove the element in the array
Array.prototype.removeEleAt = function(dx) {
if (isNaN(dx) || dx > this.length) {
return false;
}
this.splice(dx, 1);
}
// set mobile phone numbers to the table cell
function setValues() {
document.getElementById(cellnum).value =
document.getElementById("result").value;
cellnum++;
}
//-->
</script>
</head> <body>
<center>
<div> </div>
<div id="main">
<div>
<h1>Öн±ºÅÂë</h1>
<p>
<input id="result" type="text" size="30" style="height:130px;width:800px;border:2px solid
red;font-size:120;" readonly/>
</p>
<p>
<input id="start" type="button" value="¿ªÊ¼" style="border: 1px solid; border-color: #aaa 000
#000 #aaa;width:4em; background: #fc0;" onclick="setTimer()" />
<input id="end" type="button" value="Í£" style="border: 1px solid; border-color: #aaa 000
#000 #aaa;width:4em; background:
#fc0;" onclick="clearTimer()" disabled/>
</p>
<p><strong>Ò»µÈ½±£¨10Ãû£©</strong></p>
<table width="946" height="79" border="1">
<tr>
<td>
<input name="text36" type="text" id="36" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text37" type="text" id="37" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text38" type="text" id="38" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text39" type="text" id="39" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text40" type="text" id="40" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
<tr>
<td>
<input name="text41" type="text" id="41" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text42" type="text" id="42" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text43" type="text" id="43" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text44" type="text" id="44" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text45" type="text" id="45" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
</table>
<p>¶þµÈ½±£¨15Ãû£©</p>
<table width="951" height="88" border="1">
<tr>
<td>
<input name="text21" type="text" id="21" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text22" type="text" id="22" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text23" type="text" id="23" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text24" type="text" id="24" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text25" type="text" id="25" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
<tr>
<td>
<input name="text26" type="text" id="26" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text27" type="text" id="27" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text28" type="text" id="28" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text29" type="text" id="29" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text30" type="text" id="30" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
<tr>
<td>
<input name="text31" type="text" id="31" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text32" type="text" id="32" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text33" type="text" id="33" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text34" type="text" id="34" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text35" type="text" id="35" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
</table>
<p>ÈýµÈ½±£¨20Ãû£©</p>
<table width="961" height="102" border="1">
<tr>
<td>
<input name="text1" type="text" id="1" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text2" type="text" id="2" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text3" type="text" id="3" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text4" type="text" id="4" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text5" type="text" id="5" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
<tr>
<td>
<input name="text6" type="text" id="6" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text7" type="text" id="7" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text8" type="text" id="8" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text9" type="text" id="9" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text10" type="text" id="10" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
<tr>
<td>
<input name="text11" type="text" id="11" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text12" type="text" id="12" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text13" type="text" id="13" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text14" type="text" id="14" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text15" type="text" id="15" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
<tr>
<td>
<input name="text16" type="text" id="16" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="28" readonly/>
</td>
<td>
<input name="text17" type="text" id="17" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text18" type="text" id="18" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text19" type="text" id="19" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
<td>
<input name="text20" type="text" id="20" style="height:30px;width:190px;border:1px solid
red;font-size:25;" size="20" readonly/>
</td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<center>
</body> </html>
html 抽奖代码的更多相关文章
- js手机号批量滚动抽奖代码实现
我们平时在看一些选秀节目或一些歌唱类比赛节目时经常会看到在现场的大屏幕上会有观众的手机号在滚动来选出谁是幸运观众或谁中了什么奖项,这些手机号都是现场观众或场外观众在给选手投票时产生的,当主持人一声开始 ...
- jquery.rotate.js实现可选抽奖次数和中奖内容的转盘抽奖代码
需求: 抽奖代码最多可以抽奖5次,而且,每次只会中“2000元理财金”或者“谢谢参与”,其它的不会抽中(哈哈,果然都是套路). 效果如下: 一.页面结构: ? 1 2 3 4 5 6 7 8 9 10 ...
- javascript 转盘抽奖代码和计数器代码
要介绍了javascript圆盘抽奖程序实现原理和完整代码例子,需要的朋友可以参考下 看到网页上有不少大转盘抽奖的应用,心血来潮也想弄个.于是找了点资料自己研究... 效果预览: 一.模拟抽奖的实 ...
- jQueryRotate 转盘抽奖代码实现
代码如下: 例子兼容IE6,7,8 以及高版本浏览器,如有bug请回复! 1.html结构 <!doctype html> <html lang="en"> ...
- php抽奖代码
1.经典概率算法抽奖 $tmpItems = ['电脑'=>10, '相机'=>50, '100元现金'=>500]; $proSum = array_sum($tmpItems); ...
- php实现概率性随机抽奖代码
1.初始数据: 权重越大,抽取的几率越高 [奖品1, 权重 5], [ 奖品2, 权重6], [ 奖品3, 权重 7], [ 奖品4, 权重2] 2.处理步骤: 1)N = 5 + 6 + 7 + 2 ...
- php按照奖品百分比随机抽奖代码分析
这个忘记从哪里copy过来了 /** * 概率算法 * @param array $probability * @return integer|string */ function get_rand( ...
- PHP抽奖代码。亲测可用
$prize_arr = array( '0' => array('id' => 1, 'title' => 'iphone5s', 'v' => 5), '1' => ...
- HTML5 Canvas绘制转盘抽奖
新项目:完整的Canvas转盘抽奖代码 https://github.com/givebest/GB-canvas-turntable 演示 http://blog.givebest.cn/GB-ca ...
随机推荐
- MySQL主从复制(Master-Slave)与读写分离(MySQL-Proxy)实践
主服务器上(注:应该是允许从机访问) GRANT REPLICATION SLAVE ON *.* to ‘rep1’@’192.168.10.131’ identified by ‘passwor ...
- poj3616 LIS变形
题目链接:http://poj.org/problem?id=3616 题意:给出m组数据a,b,c代表在第a分钟到第b分钟产生c个效益,问最大产生多少效益(区间不能重叠,每次工作完必须歇息R分钟) ...
- Python与Hack
1.Python的函数:关键字def()表示函数开始,可以在括号内填写任何变量,然后这些变量会被以引用的方式传递给函数,也就是说,函数内对这些变量的任何改变都会影响它们在主调函数中的值: 2.迭代:用 ...
- POJ 2549 二分+HASH
题目链接:http://poj.org/problem?id=2002 题意:给定一个n个数字组成的序列,然后求出4个数使得a+b+c=d,求d的最大值.其中a,b,c,d要求是给定序列的数,并且不能 ...
- 【CLR in c#】参数
1.可选参数和命名参数 设计一个参数时,可为部分或全部参数分配默认值,调用这些方法的代码可以选择不指定部分实参,接受默认值,还可以通过制定参数名称的方式传递实参.如下 class CLR可选参数 { ...
- Codeforces 660C Hard Process(尺取法)
题目大概说给一个由01组成的序列,要求最多把k个0改成1使得连续的1的个数最多,输出一种方案. 和CF 676C相似. #include<cstdio> #include<algor ...
- Zookeeper 3.4.6 Client端流程粗略梳理
首先从Zookeeper入手,Zookeeper-->ClientCnxn-->sendThread/eventThread public ZooKeeper(String connect ...
- iOS学习30之UITableView编辑
1. UITableView编辑 1> UITableView 编辑流程 2> UITableView 编辑步骤(四步) ① 第一步 : 让 TableView 处于编辑状态(在按钮点击事 ...
- why cpp is a shitty language
// the below is a standard template for any of my writings about c++ cpp_is_a_shitty_language_as { t ...
- 51Nod 1079 中国剩余定理 Label:数论
一个正整数K,给出K Mod 一些质数的结果,求符合条件的最小的K.例如,K % 2 = 1, K % 3 = 2, K % 5 = 3.符合条件的最小的K = 23. Input 第1行:1个数 ...