图形倒计时结合

   小试身手,作业结合体!!

<html>
<head>
<title>图形倒计时结合</title>
<script type="text/javascript">
  for(var i=1;i<=8;i++){
      for(var k=8;k>=i;k--)
       document.write("#");
   for(var j=1;j<=i;j++)
       document.write("*");
   document.write("<br>");
   }
   count=11;
  function countDown(){ 
 count--;
    writeNumber(count);
    if (count>0){
      window.setTimeout("countDown();",1000);  //  每隔一秒钟调用本函数
    }
  }
  function writeNumber(count) {
    document.getElementById("content").innerHTML = count;
  }
 
</script>
</head>
<body onload="countDown();">
  <div style="font:100px tahoma bold ; color:teal;text-align:center ;margin-top:10px" id="content" ;></div>
</body>
</html>

posted @ 2012-03-12 12:37  yangkai_keven  阅读(105)  评论(0编辑  收藏  举报