{ js }

  • 简单数字时钟js

    | /
    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

    <!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>
    <title>exam time</title>
    <style>
    .time { font-size: 300pt; line-height: 200%; color:b;}
    </style>
    <script type="text/javascript">
    var getObj = function(id){
    if(!id){
    return false;
    }
    return document.getElementById(id);
    };
    <!-- Hiding
    var ctimer;

    function settimes(){

    var time= new Date();
    hours= time.getHours();
    mins= time.getMinutes();
    secs= time.getSeconds();
    if (hours<10)
    hours="0"+hours;
    if(mins<10)
    mins="0"+mins;
    if (secs<10)
    secs="0"+secs;
    getObj('tim1').innerHTML=hours+":"+mins+":"+secs
    ctimer=setTimeout('settimes()',960);
    }
    // Done hiding -->
    </script>
    <title>js data clock</title>
    </head>
    <body onload="settimes()">
    <!---->
    <!--<div class=time id=tim1 style="height: 500px; left: 300px; position: absolute; top: 100px; width: 500px"></div>-->
    <div class=time id=tim1 style="text-align:center"></div>
    </body>
    </html>