mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-01 05:49:58 +00:00
mouse wheel
This commit is contained in:
parent
b846cc11d8
commit
26c293308c
@ -19,9 +19,8 @@
|
|||||||
|
|
||||||
document.onreadystatechange = function () {
|
document.onreadystatechange = function () {
|
||||||
if (document.readyState == "complete") {
|
if (document.readyState == "complete") {
|
||||||
EPUBJS.filePath = "{{ url_for('static', filename='js/libs/') }}";//"js/libs/";
|
EPUBJS.filePath = "{{ url_for('static', filename='js/libs/') }}";
|
||||||
EPUBJS.cssPath = "{{ url_for('static', filename='css/') }}";//window.location.href.replace(window.location.hash, '').replace('read.html', '') + "css/";
|
EPUBJS.cssPath = "{{ url_for('static', filename='css/') }}";
|
||||||
// fileStorage.filePath = EPUBJS.filePath;
|
|
||||||
|
|
||||||
window.reader = ePubReader("{{ url_for('static', filename=bookid) }}/");
|
window.reader = ePubReader("{{ url_for('static', filename=bookid) }}/");
|
||||||
//keybind
|
//keybind
|
||||||
@ -33,6 +32,21 @@
|
|||||||
window.reader.book.nextPage();
|
window.reader.book.nextPage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//bind mouse
|
||||||
|
$(window).bind('DOMMouseScroll mousewheel', function(event) {
|
||||||
|
var delta = 0;
|
||||||
|
if (event.originalEvent.wheelDelta) {
|
||||||
|
delta = event.originalEvent.wheelDelta;
|
||||||
|
}else if (event.originalEvent.detail) {
|
||||||
|
delta = event.originalEvent.detail*-1;
|
||||||
|
}
|
||||||
|
if (delta >= 0) {
|
||||||
|
window.reader.book.prevPage();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.reader.book.nextPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user