diff --git a/lib/ComicBook.js b/lib/ComicBook.js index c63f009..bf20176 100644 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -61,13 +61,11 @@ function ComicBook(id, srcs, opts) { var context; // the 2d drawing context var buffer = 4; // image preload buffer level - var loaded = 0; // the amount of images that have been loaded so far - var scale = 1; // page zoom scale, 1 = 100% - + // the current page, can pass a default as a url hash - var pointer = (parseInt(window.location.hash.replace('#',''),10) - 1) || 0; + var pointer = (parseInt(location.hash.substring(1),10) - 1) || 0; /** * Figure out the cursor position relative to the canvas. @@ -267,7 +265,7 @@ function ComicBook(id, srcs, opts) { context.drawImage(page, offsetW, offsetH, page_width, page_height); if (options.displayMode === "double" && typeof page2 === "object") { context.drawImage(page2, page_width + offsetW, offsetH, page_width, page_height); } - window.location.hash = pointer + 1; + location.hash = pointer + 1; // apply any image enhancements previously defined $.each(options.enhance, function(action, options) {