为啥不显示
不显示内容
2016-07-01
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <canvas id="canvas" width="1024" height="768" style="border: 1px solid aqua;display:block;margin:auto">当前浏览器不支持,请更换浏览器</canvas> <script> window.onload=function(){ var canvas =document.getElementById("canvas"); var context =canvas.getContext("2d"); context.lineWidth=3; context.strokeStyle="black"; for(var i=0;i<10;i++){ context.beginPath(); context.arc(50+i*100,60,40,2*Math.PI*(i+1)/10); context.closePath(); context.stroke(); } } </script> </body> </html>
没有错误出现,但就是不显示圆,只显示canvas的大框
举报