1
Fork 0

Navigate through game moves by mouse wheel over the chess board.

master
vonavi 2014-07-08 17:09:24 +03:00
parent c6593632cd
commit ff744a2c19
3 changed files with 16 additions and 0 deletions

View File

@ -39,6 +39,7 @@
<!-- Tablesorter jQuery plugin -->
<script src="/assets/js/jquery.tablesorter.min.js"></script>
<script src="/assets/js/jquery.metadata.js"></script>
<script src="/assets/js/jquery.mousewheel.min.js"></script>
<!-- Custom JavaScript based on Bootstrap and jQuery -->
<script src="/assets/js/custom.js"></script>

View File

@ -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();

1
assets/js/jquery.mousewheel.min.js vendored Symbolic link
View File

@ -0,0 +1 @@
../vendor/jquery-mousewheel/jquery.mousewheel.min.js