网站地图    收藏   

主页 > 前端 > css教程 >

简单的随机抽取系统--html--js - html/css语言栏目:

来源:自学PHP网    时间:2015-04-14 14:50 作者: 阅读:

[导读] [html]!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlns=http://www.w3.org/1999/xhtmlheadmeta http-......

[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> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>无标题文档</title> 
<script type="text/javascript"> 
var names=new Array("蔡帅","常赛赛","陈晨","陈俊","陈磊","陈晓东","陈楠","杜广伟","段礼想","范晓峡","冯贺娟","高春发","高洋","葛阳","郭博","何素芳","何晓伟","胡军鹏","黄文春","惠媛佩","靳培强","李传允","李浩博","李俊锋","李乐乐","李品","李伟峰","李文博","李亚伟","李益芳","梁建","刘洪超","刘利丹","刘松松","罗凯凯","马王莹","苗珺杰","聂鹏英","秦仕朋","沈冬冬","石亚博","时宁","王高杨","王恒","王腾飞","王小洁","吴南","肖桦","杨琪琳","余洋","岳亚鹏","曾书雅","张安新","张佰俊","张二强","张俊棋","张涛","张小换","张扬","张洋","张元英","周冲冲","周更新"); 
function showName(){ 
    var index = Math.floor(Math.random()*names.length); 
    var name = names[index]; 
    document.getElementById("showView").innerHTML = name; 
    idd=setTimeout("showName()",50); 

var state = true; 
var idd; 
function sssss(){ 
    if(state){ 
        showName(); 
        state = false; 
    } 
    else{ 
        clearTimeout(idd); 
        state = true; 
    } 
         

 
 
</script> 
</head> 
 
<body> 
<div id="showView" style="width:200px; height:100px; font-size:14px; color:#09C;"></div> 
<input type="button" onclick="sssss()" value="state"/> 
</body> 
</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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
var names=new Array("蔡帅","常赛赛","陈晨","陈俊","陈磊","陈晓东","陈楠","杜广伟","段礼想","范晓峡","冯贺娟","高春发","高洋","葛阳","郭博","何素芳","何晓伟","胡军鹏","黄文春","惠媛佩","靳培强","李传允","李浩博","李俊锋","李乐乐","李品","李伟峰","李文博","李亚伟","李益芳","梁建","刘洪超","刘利丹","刘松松","罗凯凯","马王莹","苗珺杰","聂鹏英","秦仕朋","沈冬冬","石亚博","时宁","王高杨","王恒","王腾飞","王小洁","吴南","肖桦","杨琪琳","余洋","岳亚鹏","曾书雅","张安新","张佰俊","张二强","张俊棋","张涛","张小换","张扬","张洋","张元英","周冲冲","周更新");
function showName(){
 var index = Math.floor(Math.random()*names.length);
 var name = names[index];
 document.getElementById("showView").innerHTML = name;
 idd=setTimeout("showName()",50);
}
var state = true;
var idd;
function sssss(){
 if(state){
  showName();
  state = false;
 }
 else{
  clearTimeout(idd);
  state = true;
 }
  
}


</script>
</head>

<body>
<div id="showView" style="width:200px; height:100px; font-size:14px; color:#09C;"></div>
<input type="button" onclick="sssss()" value="state"/>
</body>
</html>

 

 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论