已采纳回答 / 未来开拓者
var chess =document.getElementById("chess");var context=chess.getContext("2d");var chessBoard=[];var me=true;for(var i=0;i<15;i++){ chessBoard[i]=[]; for(var j=0;j<15;j++) chessBoard[i][j]=0; }context.strokeStyle="#BFBFBF";var logo=new Image();logo...
2016-07-18
var distance = Math.hypot(a, b);
var chessRange = Math.sqrt(50, 2);
if(distance < chessRange) {
chess.style.cursor = "pointer";
}
}
}
}
var chessRange = Math.sqrt(50, 2);
if(distance < chessRange) {
chess.style.cursor = "pointer";
}
}
}
}
function changeCursor(e) {
chess.style.cursor = "default";
var x = e.offsetX;
var y = e.offsetY;
for(var i=0;i<15;i++) {
for(var j=0;j<15;j++) {
var a = x - (15 + i*30);
var b = y - (15 + j*30);
chess.style.cursor = "default";
var x = e.offsetX;
var y = e.offsetY;
for(var i=0;i<15;i++) {
for(var j=0;j<15;j++) {
var a = x - (15 + i*30);
var b = y - (15 + j*30);