From: rajbot Date: Wed, 24 Nov 2010 00:15:15 +0000 (+0000) Subject: move book gutter image (#BRbookspine) half-way during flip animation. X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=commitdiff_plain;h=637d2507504979844b19640ee54c3877b974a813 move book gutter image (#BRbookspine) half-way during flip animation. --- diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index 161083a..e6b1c7b 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -2191,6 +2191,8 @@ BookReader.prototype.flipLeftToRight = function(newIndexL, newIndexR) { //console.log(' and now leafEdgeTmp to left: gutter+newWidthR ' + (gutter + newWidthR)); $(self.leafEdgeTmp).animate({left: gutter+newWidthR+'px'}, self.flipSpeed, 'easeOutSine'); + + $('#BRbookspine').css({left: (gutter - self.twoPage.bookSpineDivWidth*0.5)+'px'}); //console.log(' animating newIndexR ' + newIndexR + ' to ' + newWidthR + ' from ' + $(self.prefetchedImgs[newIndexR]).width()); $(self.prefetchedImgs[newIndexR]).animate({width: newWidthR+'px'}, self.flipSpeed, 'easeOutSine', function() { @@ -2212,9 +2214,7 @@ BookReader.prototype.flipLeftToRight = function(newIndexL, newIndexR) { $(self.twoPage.coverDiv).css({ width: self.twoPageCoverWidth(newWidthL+newWidthR)+'px', left: gutter-newWidthL-newLeafEdgeWidthL-self.twoPage.coverInternalPadding+'px' - }); - - $('#BRbookspine').css({left: (gutter - self.twoPage.bookSpineDivWidth*0.5)+'px'}); + }); $(self.leafEdgeTmp).remove(); self.leafEdgeTmp = null; @@ -2341,6 +2341,7 @@ BookReader.prototype.flipRightToLeft = function(newIndexL, newIndexR) { $(this.leafEdgeTmp).animate({left: gutter}, speed, 'easeInSine'); $(this.prefetchedImgs[this.twoPage.currentIndexR]).animate({width: '0px'}, speed, 'easeInSine', function() { + $('#BRbookspine').css({left: (gutter - self.twoPage.bookSpineDivWidth*0.5)+'px'}); $(self.leafEdgeTmp).animate({left: gutter-newWidthL-leafEdgeTmpW+'px'}, speed, 'easeOutSine'); $(self.prefetchedImgs[newIndexL]).animate({width: newWidthL+'px'}, speed, 'easeOutSine', function() { $(self.prefetchedImgs[newIndexR]).css('zIndex', 2); @@ -2354,9 +2355,7 @@ BookReader.prototype.flipRightToLeft = function(newIndexL, newIndexR) { $(self.twoPage.coverDiv).css({ width: self.twoPageCoverWidth(newWidthL+newWidthR)+'px', left: gutter - newWidthL - newLeafEdgeWidthL - self.twoPage.coverInternalPadding + 'px' - }); - - $('#BRbookspine').css({left: (gutter - self.twoPage.bookSpineDivWidth*0.5)+'px'}); + }); $(self.leafEdgeTmp).remove(); self.leafEdgeTmp = null;