관리 메뉴

moozi

7/2 html5 2반 시계 배경 본문

카테고리 없음

7/2 html5 2반 시계 배경

moozi 2015. 7. 2. 11:53

<html>
    <head>
        <title>시계</title>
         <script>
            function g(){
                var canvas=document.getElementById("myCanvas");
                var paint=canvas.getContext("2d");   
               paint.fillStyle="white";
                var radius=canvas.height/2;
                paint.translate(radius,radius);//원점(0,0)을 (150,150)으로이동
                paint.arc(0, 0, radius*0.9, 0 ,2*Math.PI);
                paint.fill();
               
                paint.beginPath();
                paint.arc(0, 0, 20, 0, 2*Math.PI);
                paint.fillStyle = "#333333";
                paint.fill();
               
            }
        </script>
    </head>
  
    <body onLoad="g()">
        <canvas id="myCanvas" width="300" height="300" style="background-color:#dddddd"></canvas>
   
    </body>

</html>

Comments