Added function to use arrow keys to change pages in ComicBook.js

This commit is contained in:
kennethlarsen 2012-10-11 21:47:45 +02:00
parent 01a1e44ac4
commit 0f8fcca070

View file

@ -321,7 +321,19 @@ function ComicBook(id, srcs, opts) {
.attr("id", "cb-loading-overlay")
.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() {
$(canvas)