1

I want player 2 to see what last move player 1 has moved. The best way to do this would be to highlight the last move. How is it possible in chessboard.JS?

1 Answers1

1

I wasn't familiar with chessboard.js - but a quick search of their site turned up an example entitled Piece Highlight 1, which seems to do just that. The link includes both javascript and HTML examples, depending on which you're looking for.

Since links are not permanent, here is the HTML example:

<style type="text/css">
.highlight-white {
  -webkit-box-shadow: inset 0 0 3px 3px yellow;
  -moz-box-shadow: inset 0 0 3px 3px yellow;
  box-shadow: inset 0 0 3px 3px yellow;  
}
.highlight-black {
  -webkit-box-shadow: inset 0 0 3px 3px blue;
  -moz-box-shadow: inset 0 0 3px 3px blue;
  box-shadow: inset 0 0 3px 3px blue;  
}
</style>
<script src="js/chess.js"></script>
<div id="board" style="width: 400px"></div>
Ghotir
  • 730
  • 1
  • 7
  • 11