scrollIntoView
This commit is contained in:
parent
5058e1f3fd
commit
2e00b8c9ce
2 changed files with 3 additions and 1 deletions
|
@ -41,12 +41,14 @@ function Comic(root, comicURL) {
|
||||||
this.prev = function() {
|
this.prev = function() {
|
||||||
if(self.comicPage > 0) {
|
if(self.comicPage > 0) {
|
||||||
self.setPage(self.comicPage-1);
|
self.setPage(self.comicPage-1);
|
||||||
|
document.getElementById("comicMain").scrollIntoView();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.next = function() {
|
this.next = function() {
|
||||||
if(self.comicPage < self.comicPages.length) {
|
if(self.comicPage < self.comicPages.length) {
|
||||||
self.setPage(self.comicPage+1);
|
self.setPage(self.comicPage+1);
|
||||||
|
document.getElementById("comicMain").scrollIntoView();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
/** setup arrow key bindings **/
|
/** setup arrow key bindings **/
|
||||||
$(document).keyup(function(e) {
|
document.addEventListener("keyup", function(e) {
|
||||||
if ($(e.target).is('input,textarea')) { return; }
|
if ($(e.target).is('input,textarea')) { return; }
|
||||||
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) { return; }
|
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) { return; }
|
||||||
if (e.keyCode === 37 && $("[rel='previous']").length) {
|
if (e.keyCode === 37 && $("[rel='previous']").length) {
|
||||||
|
|
Reference in a new issue