Added function to use arrow keys to change pages in ComicBook.js
This commit is contained in:
parent
01a1e44ac4
commit
0f8fcca070
1 changed files with 12 additions and 0 deletions
|
@ -321,7 +321,19 @@ function ComicBook(id, srcs, opts) {
|
||||||
.attr("id", "cb-loading-overlay")
|
.attr("id", "cb-loading-overlay")
|
||||||
.addClass("cb-control")
|
.addClass("cb-control")
|
||||||
};
|
};
|
||||||
|
/*Using left arrow key*/
|
||||||
|
$(document).keydown(function(e) {
|
||||||
|
if (e.keyCode == 37) {
|
||||||
|
ComicBook.prototype.drawPrevPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*Using right arrow key*/
|
||||||
|
$(document).keydown(function(e) {
|
||||||
|
if (e.keyCode == 39) {
|
||||||
|
ComicBook.prototype.drawNextPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
ComicBook.prototype.renderControls = function() {
|
ComicBook.prototype.renderControls = function() {
|
||||||
|
|
||||||
$(canvas)
|
$(canvas)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue