随机点名器

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>   
<style type="text/css">
#body
{
	background-color:#666666;
}
#box{
	margin:auto;
	width:50%;
	font-size:66px;
	height:300px;
	line-height:94px;
	text-align:center;
	padding:0 30px;
	margin-top:200px;
	color:#FFF;
}
#bt{
	margin:auto;
	width:200px;
	text-align:center;
	margin-top:75px;
	color:#FFF;
	font-size:25px;
	line-height:45px;
	cursor:pointer;
	height:45px;
	background-color:orange;
}
</style>
</head>

<body id="body">
<div id="box">名单</div>
<div id="bt" onclick="doit()">开始点名</div>
<div id="bt" onclick="stopit()">结束点名</div>

<script type="text/javascript">
var namelist=[
    "02010116李成基",
    "02010121张圳",
    "UI-02010302田歆妍",
    "0022250408李梓萌",
    "02010103骆文浩",
    "02010106张震宇",
    "02010107李炫宇",
    "02010108李舜禹",
    "02010111李奥",
    "02010114鲁飞洋",
    "02010115李俊达",
    "02010120王昊健",
    "02010126郑稍露",
    "02010128李正鸿",
    "02010129张诗卉",
    "02010131黄磊",
    "02010132胡坤"
];
var mytime=null;
function doit(){
	var bt=window.document.getElementById('bt');
	mytime==null
		
		show();
	}
	
function stopit(){		
	clearTimeout(mytime);
	mytime=null;
	}

function show(){
	var box=window.document.getElementById('box');
	var num=Math.floor(Math.random()*10000000)%namelist.length;
	box.innerHTML=namelist[num];
	mytime=setTimeout("show()",100);
}
</script>
</body>
</html>

开始点名时,让数组高速滚动,结束时清除时间

点名器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值