🎜>
HTML5畫圓
">http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">>
<script><br />$(document).ready(function(){<br />var c=document.getElementById("drawbox");<br />var draw=c.getContext("2d"); //取得2d內容的引用,呼叫繪圖API
<p>draw.fillStyle="red"; //顏色<br />draw.beginPath(); //從新畫<br />draw.arc(50,50,50,0,Math.PI*2,true) ; //圓心x座標|圓心y座標|直徑|始|PI為圓周率,Math.PI*2為畫圓|true為時針方向:逆時針,0為順時針,<br />draw.closePath(); //結束<br />draw.fill();<br />})<br /></script>