From fafcfcd6755642225b428013f506da985ec6dd99 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Feb 2017 18:55:12 +0300 Subject: switch pages on mouse wheel --- read.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3