翻頁時上一頁會跳一個章節(jié),老師請解決一下
epub每個目錄不是相對于一個html嗎, 就是在一個html內(nèi)翻頁上下沒問題.但是兩個html之間的,下一頁也沒問題,就是從第二個html的首頁到第一個html翻頁時(相對于上一頁),就會直接到第一個html的首頁了.請老師解答一下.謝謝老師。
vm.rendition.on('touchstart',?event?=>?{ ????vm.touchStartX?=?event.changedTouches[0].clientX; ????vm.touchStartY?=?event.changedTouches[0].clientY; ????vm.touchStartTime?=?event.timeStamp; ????//?console.log(vm.touchStartTime); ????//?console.log(event); }) vm.rendition.on('touchend',?event?=>?{ ????console.log("qqq"); ????console.log(event); ????var?offsetX?=?event.changedTouches[0].clientX?-?vm.touchStartX;//根據(jù)手離開屏幕和觸碰屏幕的正負判斷 ????var?offsetY?=?event.changedTouches[0].clientY?-?vm.touchStartY; ????var?time?=?event.timeStamp?-?vm.touchStartTime;//根據(jù)在屏幕點擊的時間判斷是否翻頁 ????if?(time?<?500?&&?offsetX?<?0?&&?Math.abs(offsetY)?<=?Math.abs(offsetX))?{ ????????vm.nextPage(); ????????vm.hideTitleAndMenu(); ????}?else?if?(time?<?500?&&?offsetX?>?0?&&?Math.abs(offsetY)?<=?Math.abs(offsetX))?{ ????????vm.prevPage(); ????????vm.hideTitleAndMenu(); ????}?else?{ ????????//顯示上下菜單 ????????vm.toggleShow(); ????} ????event.preventDefault; ????event.stopPropagation(); }) prevPage:?function?()?{ ????vm.rendition.prev().then(()?=>?{ ????????var?currentLocation?=?vm.rendition.currentLocation(); ????????var?cfi?=?currentLocation.start.cfi; ????????vm.refreshLocation(cfi); ????????var?progress?=?Math.floor(((vm.locations.percentageFromCfi(currentLocation.start.cfi)).toFixed(5))?*?10000)?/?100; ????????//?var?ppp?=?(vm.locations.percentageFromCfi(currentLocation.start.cfi)).toFixed(3); ????????vm.progress?=?progress; ????????vm.onProgressInput(progress); ????}) }, nextPage:?function?()?{ ????vm.rendition.next().then(()?=>?{ ????????var?currentLocation?=?vm.rendition.currentLocation(); ????????var?cfi?=?currentLocation.start.cfi; ????????var?progress?=?Math.floor(((vm.locations.percentageFromCfi(currentLocation.start.cfi)).toFixed(5))?*?10000)?/?100; ????????//?console.log(progress); ????????vm.refreshLocation(cfi); ????????console.log(vm.section); ????????vm.getSectionName1(); ????????vm.progress?=?progress; ????????vm.onProgressInput(progress); ????}) },