check if scrollbars are needed, only display them if they are
This commit is contained in:
parent
3655c21c20
commit
4e3d4bb463
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue