返回列表 發帖

哪裡錯ㄌ˙˙

  1. <!DOCTYPE>
  2. <head>
  3. <meta charset="utf-8">
  4. </head>
  5. <body>
  6. <div id="gameArea"><canvas id="sameCanvas"></canvas></div>
  7. <script>
  8.         var gameHeight=window.innerHeight;
  9.         var gameWidth =window.innerWidth ;
  10.         var gameArea  =document.getElementById("gameArea")  ;
  11.         var gameCanvas=document.getElementById("gameCanvas");
  12.         gameArea.style.height=gameHeight;
  13.         gameArea.style.width=gameWidth;
  14.         gameCanvas.height=gameHeight;
  15.         gameCanvas.width=gameWidth;
  16.         var ctx=gameCanvas.getContext("2d");
  17.         ctx.fillStyle="rgb(0,0,0)";
  18.         ctx.fillRect(0,0,gameWidth,gameHeight);
  19. </script>
  20. </body>
複製代碼
小雲雀

返回列表