From 2df9b56d56a3045f97402c3ff0cad6ecc320c37e Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Sat, 10 Jul 2010 12:51:12 +0100 Subject: [PATCH] scroll to the top of the page when paging through --- scripts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts.js b/scripts.js index dc66778..d222ad6 100644 --- a/scripts.js +++ b/scripts.js @@ -3,7 +3,6 @@ TODOs: Fo sho: - - The buffer is actually loading all the images at the same time, only load the next one on page.onload - Show a progress bar when buffering - use document.body.offsetWidth where present? (instead of window.innerWidth, the former excludes the width of scrollbars) - scroll two pages at a time in double page mode @@ -260,6 +259,9 @@ function ComicBook(id, srcs, opts) { ComicBook.prototype.navigation = function (e) { if (e.type === "click") { + + window.scroll(0,0); + switch (getCursorPosition(e)) { case "left": ComicBook.prototype.drawPrevPage(); break; case "right": ComicBook.prototype.drawNextPage(); break;