1
我想要做的就是創建像「遊戲」這樣的象棋。你應該能夠自由地拖動符號,就像你可以在網上找到的象棋助手一樣。真的很簡單。我可以使用JS拖動符號嗎?
但我的問題是移動的符號,是否有人能夠幫助?
`<!DOCTYPE html>
<html>
<head>
<style>
html, body {
width:100%;
height:100%;
}
.black {
background-color:silver;
}
table {
margin:auto;
text-align:center;
}
</style>
</head>
<body>
<table border="1" style="border:1px black solid;">
<tr>
<td width="40px" height="40px">♜</td>
<td class="black" width="40px" height="40px">♞</td>
<td width="40px" height="40px">♝</td>
<td class="black" width="40px" height="40px">♛</td>
<td width="40px" height="40px">♚</td>
<td class="black" width="40px" height="40px">♝</td>
<td width="40px" height="40px">♞</td>
<td class="black" width="40px" height="40px">♜</td>
</tr>
<tr>
<td class="black" width="40px" height="40px">♟</td>
<td width="40px" height="40px">♟</td>
<td class="black" width="40px" height="40px">♟</td>
<td width="40px" height="40px">♟</td>
<td class="black" width="40px" height="40px">♟</td>
<td width="40px" height="40px">♟</td>
<td class="black" width="40px" height="40px">♟</td>
<td width="40px" height="40px">♟</td>
</tr>
<tr>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
</tr>
<tr>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
</tr>
<tr>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
</tr>
<tr>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
<td class="black" width="40px" height="40px"></td>
<td width="40px" height="40px"></td>
</tr>
<tr>
<td width="40px" height="40px">♙</td>
<td class="black" width="40px" height="40px">♙</td>
<td width="40px" height="40px">♙</td>
<td class="black" width="40px" height="40px">♙</td>
<td width="40px" height="40px">♙</td>
<td class="black" width="40px" height="40px">♙</td>
<td width="40px" height="40px">♙</td>
<td class="black" width="40px" height="40px">♙</td>
</tr>
<tr>
<td class="black" width="40px" height="40px">♖</td>
<td width="40px" height="40px">♘</td>
<td class="black" width="40px" height="40px">♗</td>
<td width="40px" height="40px">♕</td>
<td class="black" width="40px" height="40px">♔</td>
<td width="40px" height="40px">♗</td>
<td class="black" width="40px" height="40px">♘</td>
<td width="40px" height="40px">♖</td>
</tr>
</table>
</body>
`