diff options
author | Andrew Dolgov <[email protected]> | 2017-02-26 18:55:12 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-02-26 18:55:12 +0300 |
commit | fafcfcd6755642225b428013f506da985ec6dd99 (patch) | |
tree | 8071e4d7748b834e2cf67cf1e295800ef13f2300 /read.html | |
parent | 4059638262e135e4497e3f790914bd9cc476389e (diff) |
switch pages on mouse wheel
Diffstat (limited to 'read.html')
-rw-r--r-- | read.html | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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); |