完整版点名器
来源:互联网 发布:非线性最优化确定参数 编辑:程序博客网 时间:2024/05/01 07:51
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
#wrap{
width: 680px;
margin: 200px auto 30px auto;
border: 1px solid gray;
text-align: center;
background-color: white;
}
#wrap div{
width: 100px;
height: 60px;
background-color: greenyellow;
border-radius: 10px;
display: inline-block;
text-align: center;
line-height: 60px;
margin: 10px;
}
input{
width: 100px;
height: 40px;
text-align: center;
line-height: 40px;
background-color: pink;
border: none;
border-radius: 10px;
font-size: 18px;
margin-left: 46%;
}
</style>
</head>
<body>
<div id="wrap">
<div>11</div>
<div>22</div>
<div>33</div>
<div>44</div>
<div>55</div>
<div>66</div>
<div>77</div>
<div>88</div>
<div>99</div>
<div>00</div>
</div>
<input type="button" name="btn" id="btn" value="开始" />
<script type="text/javascript">
var allDiv = document.getElementsByTagName('div');
var oBtn = document.getElementById('btn');
var time = null;
var compare = true;
oBtn.onclick = function(){
if (compare == true) {
time = setInterval(function(){
//得到一个随机数
var rand = parseInt(Math.random()*(allDiv.length-1)+1);
allDiv[rand].style.backgroundColor = "red";
allDiv[0].style.backgroundColor = "";
for (var i=1;i<allDiv.length;i++) {
//如果不相等则恢复原来的颜色
if (i != rand) {
allDiv[i].style.backgroundColor = "";
}
}
},30);
oBtn.value = "暂停";
} else{
clearInterval(time);
oBtn.value = "开始";
}
compare = !compare;
}
</script>
</body>
</html>
- 完整版点名器
- 点名器
- JS点名器
- 点名
- 点名
- java-随机点名器(Random )
- VB写的随机点名器代码
- 基于Ios的简单点名器程序
- OC实现简单的点名器
- JAVA基础 随机点名器案例
- 一个简单的随机点名器。
- 【Java】随机点名器的实现
- 完整版
- javaSE学习笔记——随机点名器
- Java实现一个简单的随机点名器
- IOS 学的容易----随机点名器内部实现
- HTML5_制作点名器-math-date-计时器
- HTML5_验证码-点名器-倒计时-function-放大镜
- shFlags Introduction
- ibm_system 3650安装
- 数据库创建(CREATE),数据库的修改(Update),数据库的删除(ALERT)
- poj2553 The Bottom of a Graph--Kosaraju算法 & 缩点 & 强连通分量
- Maven之(一)Maven是什么
- 完整版点名器
- 文章标题
- 216_实现width宽度充满占满屏幕的底部菜单dialog
- Ubuntu以太网已断开的解决办法
- Day32、IPC进程间通信(共享内存)、网络基础知识
- 前台页面的国际化处理
- mysql中外键约束级联更新与删除
- c++基础(6-8)
- 在Python中实现你自己的推荐系统【转载】