Brett Ausrichtung

 

 

 

JavaScript

var ruyLopez = 'r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R';
var board = new ChessBoard('board', ruyLopez);

$('#showOrientationBtn').on('click', function() {
  console.log("Board orientation is: " + board.orientation());
});

$('#flipOrientationBtn').on('click', board.flip);

$('#whiteOrientationBtn').on('click', function() {
  board.orientation('white');
});

$('#blackOrientationBtn').on('click', function() {
  board.orientation('black');
});

HTML

<div id="board" style="width: 400px"></div>
<input type="button" id="showOrientationBtn" value="Show orientation in console" />
<input type="button" id="flipOrientationBtn" value="Flip orientation" /><br />
<input type="button" id="whiteOrientationBtn" value="White orientation" />
<input type="button" id="blackOrientationBtn" value="Black orientation" />