Set background colour of beginning/end facing page to transparent
authorMichael Ang <mang@archive.org>
Fri, 21 May 2010 00:43:16 +0000 (00:43 +0000)
committerMichael Ang <mang@archive.org>
Fri, 21 May 2010 00:43:16 +0000 (00:43 +0000)
BookReader/BookReader.js

index 7f23ef4..176b56c 100644 (file)
@@ -2309,6 +2309,12 @@ BookReader.prototype.prefetchImg = function(index) {
         //console.log('prefetching ' + index);
         var img = document.createElement("img");
         img.className = 'BRpageimage';
+        if (index < 0 || index > (this.numLeafs - 1) ) {
+            // Facing page at beginning or end, or beyond
+            $(img).css({
+                'background-color': 'transparent'
+            });
+        }
         img.src = pageURI;
         img.uri = pageURI; // browser may rewrite src so we stash raw URI here
         this.prefetchedImgs[index] = img;