<head>
<meta charset=utf-8 />
</head>
<body onload="draw();">
<canvas id="circle" width="500" height="500" style="border:1px solid grey"></canvas>
<script>
function draw()
{
let canvas = document.getElementById('circle');
let ctx = canvas.getContext('2d');
let X = canvas.width / 2;
let Y = canvas.height / 2;
let R = 45;
ctx.beginPath();
ctx.arc(X,Y, R, 0, 2 * Math.PI, false);
ctx.strokeStyle = '#FF0000';
ctx.stroke();
let idinterval = setInterval(function(){
ctx.arc(X,Y, R, 0, 2 * Math.PI, false);
ctx.strokeStyle = '#FF0000';
ctx.stroke();
R = R + 1;
},100);
}
</script>
</body>
|