summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-26 18:55:12 +0300
committerAndrew Dolgov <[email protected]>2017-02-26 18:55:12 +0300
commitfafcfcd6755642225b428013f506da985ec6dd99 (patch)
tree8071e4d7748b834e2cf67cf1e295800ef13f2300
parent4059638262e135e4497e3f790914bd9cc476389e (diff)
switch pages on mouse wheel
-rw-r--r--read.html15
1 files changed, 14 insertions, 1 deletions
diff --git a/read.html b/read.html
index 4c4a3d7..f42fa82 100644
--- a/read.html
+++ b/read.html
@@ -326,6 +326,18 @@
});
})
+ book.on("renderer:chapterDisplayed", function() {
+ $("#reader iframe")[0].contentWindow.onmousewheel = function(event) {
+
+ if (event.deltaY > 0) {
+ book.nextPage();
+ } else if (event.deltaY < 0) {
+ book.prevPage();
+ }
+
+ };
+ });
+
book.on("renderer:keydown", hotkey_handler);
book.getMetadata().then(function(meta){
@@ -334,7 +346,7 @@
});
rendered.then(function() {
-
+
localforage.getItem(cacheId("pagination")).then(function(pageList) {
if (pageList && book.loadPagination(pageList).length > 0) {
@@ -413,6 +425,7 @@
});
book.on('book:pageChanged', function(location) {
+
//console.log(location);
$(".loading").hide();
$("#cur_page").html(location.anchorPage);