Navigate through game moves by mouse wheel over the chess board.
This commit is contained in:
parent
c6593632cd
commit
ff744a2c19
@ -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>
|
||||
|
@ -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
1
assets/js/jquery.mousewheel.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../vendor/jquery-mousewheel/jquery.mousewheel.min.js
|
Loading…
Reference in New Issue
Block a user