this.rendition.on—里面设置touchstart、touchend这两个事件没有反映

来源:4-3 阅读器翻页功能实现

慕先生7121026

2019-04-16

老师好,
我这也出现了这个问题,我把版本降低了之后,也还是没有反应…
initEpub () {
const url = ‘’ + this.fileName + '.epub’
console.log(url)
this.book = new Epub(url)
console.log(this.book)
this.rendition = this.book.renderTo(‘read’, {
width: window.innerWidth,
height: window.innerHeight,
method: ‘default’
})
console.log(this.rendition)
this.rendition.display()
this.rendition.on(‘touchstart’, event => {
console.log(event)
})
this.rendition.on(‘touchend’, event => {
console.log(event)
})
}
手机预览模式下也能渲染出来,book和rendition也都能打印出来,除了降低版本,还有其他的需要注意的地方吗?

写回答

1回答

Sam

2019-04-16

你好,touch事件只能在手机模式下才能使用,在PC端环境下用不了,课程后面会采用mouse事件来进行改造,以获得更好的兼容性:)

0
1
慕先生7121026
非常感谢!
2019-04-17
共1条回复

Vue 实战商业级读书Web APP完整项目

Vue全家桶+最新前端技术+前后端分离架构,完整项目流程

1610 学习 · 1951 问题

查看课程