zoukankan      html  css  js  c++  java
  • 抽签网页板代码

    <!doctype html>
    <HTML>
    <HEAD>
    <meta charset="utf-8">
    <style type="text/css">
    body{
    font-size:100px;
    text-align:center;
    }
    input{
    350px;
    height:140px;
    font-size:80px;
    }
    </style>
    <TITLE>抽签网页版</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    var names = [
    "01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22"
    ];

    var name;
    var index = -1;
    var time;
    function begin(){
    document.getElementById("btnBegin").disabled = true;
    chouqian();
    }
    function chouqian(){
    if(names.length > 0){
    index = Math.floor(Math.random()*1000 % names.length);
    name = names[index];
    document.getElementById("result").innerHTML = name;

    time = window.setTimeout(chouqian,2);
    }else{
    document.getElementById("result").innerHTML = "~结束~";
    }
    }
    function end(){
    window.clearTimeout(time);
    document.getElementById("btnBegin").disabled = false;
    names.splice(index, 1);
    }
    </SCRIPT>
    </HEAD>

    <BODY>

    <div>
    <h3>抽签顺序</h3>
    <h1 id="result" style="color:blue;">^_^</h1>
    <INPUT TYPE="button" VALUE="开始" id="btnBegin" ONCLICK="begin();">
    <INPUT TYPE="button" VALUE="结束" id="btnEnd" ONCLICK="end();">
    </div>
    </BODY>
    </HTML>

  • 相关阅读:
    JavaScript中的数组
    JavaScript中的对象
    Highcharts中设置x轴为时间的写法
    CSS 选择器(基础)
    DOM节点
    平衡木蜻蜓
    python2.7 qt4
    C语言优先级
    树莓派与stm32通信
    linux下USB转串口配置
  • 原文地址:https://www.cnblogs.com/httpssl/p/11082188.html
Copyright © 2011-2022 走看看