美女时钟

<!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></title>
    <script type="text/javascript">
      function Fill2Len(i){
          if (i < 10) {
              return "0" + i;
          }
          else {
              return i;
          }
      }

        function Refresh() {
            var imgMM = document.getElementById('imgMM');
            if (!imgMM) {
                return;
            }
            else {
                var now = new Date();
                var seconds = now.getSeconds();
                imgMM.src = "imgs/" + Fill2Len(seconds) + ".gif";
            }
        }
        setInterval("Refresh()",1000);
    </script>
</head>
<body onload="Refresh()">
<img id="imgMM"  />
</body>
</html>

posted @ 2012-11-24 21:29  FiberHomer  阅读(124)  评论(0编辑  收藏  举报