From 4e3d4bb463e2a652af9d38a1c5c6c366e02b0cc9 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Sat, 10 Jul 2010 14:01:39 +0100 Subject: [PATCH] check if scrollbars are needed, only display them if they are --- scripts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts.js b/scripts.js index 46f237f..bd3e58f 100644 --- a/scripts.js +++ b/scripts.js @@ -223,6 +223,10 @@ function ComicBook(id, srcs, opts) { canvas.width = (canvas_width < window.innerWidth) ? window.innerWidth : canvas_width; canvas.height = (canvas_height < window.innerHeight) ? window.innerHeight : canvas_height; + // disable scrollbars if not needed + document.body.style.overflowX = (canvas_width < window.innerWidth) ? "hidden" : "auto"; + document.body.style.overflowY = (canvas_height < window.innerHeight) ? "hidden" : "auto"; + // work out a horizonal position that will keep the pages always centred if (canvas_width < window.innerWidth && options.zoomMode === "manual") { offsetW = (window.innerWidth - page_width) / 2;