[JavaScript ¼Ò½º]
<html>
<head>
<title> Today Mission </title>
<script language="javascript">
function fun()
{
var c=document.getElementById("cvs1").getContext("2d");
c.beginPath();
c.strokeStyle="#4374D9";
c.moveTo(0,250); c.lineTo(800,250);
c.moveTo(400,0); c.lineTo(400,500);
c.stroke();
c.beginPath();
c.strokeStyle="#FF0000";
r=100;
for(x=-300; x<=300; x++){
y= x;
if(x==-300) c.moveTo(x+400, 250-y);
else c.lineTo(x+400,250-y);
}
c.stroke();
c.beginPath();
c.strokeStyle="#FF0000";
c.moveTo(300+100,150);
c.arc(300,150,100,0,Math.PI*2);
c.stroke();
c.beginPath();
c.strokeStyle="#FFFF00";
c.moveTo(20,20);
c.arcTo(300,20,300,120,100);
c.stroke();
c.beginPath();
c.strokeStyle="#FF00FF";
c.moveTo(20,20);
c.quadraticCurveTo(20,300,350,100);
c.stroke();
}
</script>
</head>
<body>
<h1> Today Mission </h1>
<input type="button" value="go function~" onClick="fun()"><br>
<canvas id="cvs1" width="800" height="500" style="border:1px solid#000000">
</canvas>
</body>
</html>
|