翻页时上一页会跳一个章节,老师请解决一下
epub每个目录不是相对于一个html吗, 就是在一个html内翻页上下没问题.但是两个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;//根据手离开屏幕和触碰屏幕的正负判断 var offsetY = event.changedTouches[0].clientY - vm.touchStartY; var time = event.timeStamp - vm.touchStartTime;//根据在屏幕点击的时间判断是否翻页 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); }) },