diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 71bd4c1..a16105d 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -486,8 +486,13 @@ function ComicBook(id, srcs, opts) { 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 + + 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 + + // update the interal scale var so switching zoomModes while zooming will be smooth + scale = zoom_scale break; default: