Red King

xiangqiboard.js

The easiest way to embed a xiangqi/chinese chess board on your site.

Download v0.3.3

As easy as two lines.

HTML

<div id="board1" style="width: 450px"></div>

JavaScript

const board1 = Xiangqiboard('board1', 'start')

Customize with a powerful API.

HTML

<div id="board2" style="width: 450px"></div>
<button id="startBtn">Start Position</button>
<button id="clearBtn">Clear Board</button>

JavaScript

const board2 = Xiangqiboard('board2', {
  draggable: true,
  dropOffBoard: 'trash',
  sparePieces: true
})

$('#startBtn').on('click', board2.start)
$('#clearBtn').on('click', board2.clear)