效果显示不出来
var chess=document.getElementById('chess');
var context=chess.getContext('2d');
context.strokeStyle="#bfbfbf";
var logo=new Image();
logo.src="images/慕课图标.png";
logo.onload=function(){
context.drawImage(logo,0,0,450,450);
drawChessBoard();
context.beginPath();
context.arc(200,200,100,0,2*Math.PI);
context.closePath();
context.fill();
}
var drawChessBoard=function(){
for (var i = 0; i < 15; i++) {
context.moveTo(15+i*30,15);
context.lineTo(15+i*30,435);
context.stroke();
context.moveTo(15,15+i*30);
context.lineTo(435,15+i*30);
context.stroke();
}
}
我照代码敲的 就是图片跟棋子都出不来效果