查找通过Javascript在EPUB FXL中查看页面的时间 [英] FInding out when page is being viewed in EPUB FXL via Javascript

查看:109
本文介绍了查找通过Javascript在EPUB FXL中查看页面的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以找出使用Javascript查看EPUB固定版面的页面?

Is it possible to find out when a page of an EPUB Fixed Layout is being viewed with Javascript?

有DOMContentLoaded事件,但是相邻页面在iBooks中预加载时也会触发此事件,从而导致动画或声音在页面可见之前开始.

There is the DOMContentLoaded event, but the adjacent pages also fire this event when they are preloaded in iBooks, causing animations or sounds to start before the page being visible...

推荐答案

不,不是.

这是iBooks的功能".它预装了页面,我想稍后可以使页面翻动更快.不幸的是,无法检测到页面正在预加载,而不是实际查看.

This is a "feature" of iBooks. It preloads the pages, I suppose to make page turns faster later on. Unfortunately, there is no way to detect that a page is preloading as opposed to being actually viewed.

只有一种方法可以解决此问题-在每个页面上强制用户交互(轻按某些内容)以启动动画或声音.您甚至可能需要对JS进行结构化,以便在与用户进行交互之前才加载JS本身.无论如何,视频都不会在没有用户交互的情况下开始播放.

There's only one way to deal with this--force user interaction on each page (tapping something) to start the animations or sounds. You may even need to structure your JS so that the JS itself is not loaded until the user interaction occurs. Videos won't start playing without user interaction anyway.

这篇关于查找通过Javascript在EPUB FXL中查看页面的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆