-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource code.html
56 lines (48 loc) · 1.58 KB
/
source code.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!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">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
body{font:12px/180% "Microsoft YaHei","微软雅黑", "宋体";
background-color:#CCC;
opacity:0.9;
}
#box{margin:auto;width:660px;font-size:66px;height:94px;line-height:94px;overflow:hidden;color:#138eee;text-align:center;padding:0 30px;margin-top:200px;}
#bt{margin:auto;width:200px;text-align:center;margin-top:75px;color:#fff;font-size:25px;line-height:45px;cursor:pointer;
background-color:#09F;
}
</style>
<script type="text/javascript">
var list="学生名单";
<!--学生与学生之间用英文逗号隔开。-->
var namelist=list.split(",");
var mytime=null;
function doit(){
var bt=window.document.getElementById("bt");
if(mytime==null){
bt.innerHTML="停止点名";
show();
}else{
bt.innerHTML="开始点名";
clearTimeout(mytime);
mytime=null;
}
}
function show(){
var box=window.document.getElementById("box");
var num=Math.floor((Math.random()*100000))%namelist.length;
box.innerHTML=namelist[num];
mytime=setTimeout("show()",1);
}
</script>
</head>
<body id="bodybj">
<div id="box">亲,准备好了吗?</div>
<div id="bt" onClick="doit()">开始点名</div>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>
</body>
</html>