diff --git a/_layouts/default.html b/_layouts/default.html index 1372ca6..1d2a730 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -39,6 +39,7 @@ + diff --git a/assets/js/custom.js b/assets/js/custom.js index 474c666..f6d3d02 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -17,12 +17,26 @@ $(function() { sortReset : true, sortRestart : true }); + + /* Navigate through game moves by mouse wheel over the chess board */ + $('#GameBoard').mousewheel(function(event) { + if (event.deltaY == -1) { + $('#forwardButton').click(); + } else if (event.deltaY == 1) { + $('#backButton').click(); + } + event.stopPropagation(); + return false; + }); }) /* Stylize pgn4web elements by Bootstrap */ function customFunctionOnPgnGameLoad() { $('#GameSelSelect').addClass('form-control'); $('#autoplayButton').click(refreshButtonset); + + /* No titles for mouse wheel over the chess board */ + $('#GameBoard .pieceImage').removeAttr('title'); } function customFunctionOnMove() { refreshButtonset(); diff --git a/assets/js/jquery.mousewheel.min.js b/assets/js/jquery.mousewheel.min.js new file mode 120000 index 0000000..f31808d --- /dev/null +++ b/assets/js/jquery.mousewheel.min.js @@ -0,0 +1 @@ +../vendor/jquery-mousewheel/jquery.mousewheel.min.js \ No newline at end of file