qq_machine_vBFP45
2018-10-20 20:36
点击上一页下一页怎么让进度条变化?
你好,需要使用Locations对象来实现
this.rendition.next().then(() => {
// 获取当前的位置信息
const currentLocation = this.rendition.currentLocation()
// 获取当前位置的进度百分比
this.progress = this.locations.percentageFromCfi(currentLocation.start.cfi)}
)将progress与input滑块绑定,这样就可以在更新progress后,自动更新进度条了
具体实现思路和原理可以查看我近期发布的一篇手记:https://www.imooc.com/article/255112
快速入门Web阅读器开发
26535 学习 · 228 问题
相似问题