diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 1f98954..c00474e 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -445,7 +445,7 @@ function ComicBook(id, srcs, opts) { pages[i] = this; loaded.push(i); - // start to load from the begining if loading started midway + // start to load from the beginning if loading started midway if (i === no_pages-1 && loaded.length !== no_pages) { i = -1; } @@ -458,6 +458,7 @@ function ComicBook(id, srcs, opts) { //console.log(loaded[loaded.length-1]); + // double page mode needs an extra page added to the buffer padding = (options.displayMode === "double") ? 1 : 0; // start rendering the comic when the buffer level has been reached (FIXME: buggy, fails if trying to load the last couple of pages) @@ -606,6 +607,9 @@ function ComicBook(id, srcs, opts) { if (getHash() !== pointer) { setHash(pointer + 1); } + + // make sure the top of the page is in view + window.scroll(0, 0); }; /** @@ -778,8 +782,6 @@ function ComicBook(id, srcs, opts) { e.stopPropagation(); - window.scroll(0, 0); // make sure the top of the page is in view - // western style (left to right) if (!options.manga) { if (side === "left") { ComicBook.prototype.drawPrevPage(); }