js的代码
window.onload = function () {
var chess = document.getElementById('chess');
var context = chess.getContext('2d');
context.srtokeStyle = "#BFBFBF";
context.moveTo(0,0);
context.lineTo(450,450);
context.stroke();
}
index的代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>五子棋</title>
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<body>
<canvas id = "chess" width = "450px" height = "450px"></canvas>
<script type="text/javascript" scr="js/script.js"></script>
</body>
</html>
慕瓜9542731
zhaosixing
相关分类