From 4d6651818d9bb33168a7a28e446140ce1e1ca276 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Sat, 10 Jul 2010 13:49:42 +0100 Subject: [PATCH] disable horizontal scrollbars in fitWidth mode --- scripts.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts.js b/scripts.js index a85d04a..fbf3c03 100644 --- a/scripts.js +++ b/scripts.js @@ -18,6 +18,8 @@ */ + + /** * Merge two arrays. Any properties in b will replace the same properties in * a. New properties from b will be added to a. @@ -63,7 +65,7 @@ function ComicBook(id, srcs, opts) { var loaded = 0; // the amount of images that have been loaded so far var scale = 1; // page zoom scale, 1 = 100% - + /** * Figure out the cursor position relative to the canvas. * @@ -192,10 +194,12 @@ function ComicBook(id, srcs, opts) { switch(options.zoomMode) { case "manual": + document.body.style.overflowX = "auto" zoom_scale = (options.displayMode === "double") ? scale * 2 : scale; break; case "fitWidth": + document.body.style.overflowX = "hidden" zoom_scale = (window.innerWidth > width) ? ((window.innerWidth - width) / window.innerWidth) + 1 // scale up if the window is wider than the page : window.innerWidth / width; // scale down if the window is narrower than the page break;